1 (edited by kavinacomputers 2024-07-13 12:58:48)

Topic: How to link selected grid rows to counter in different table?

Hello Guys Evening To Everyone.

I am trying to link multiple selected rows from table grid to counter in counter table.

Which I don't know how to do it.

Post's attachments

Attachment icon linkrefsave.zip 326.76 kb, 130 downloads since 2024-07-13 

Re: How to link selected grid rows to counter in different table?

Hi,
I had a quick look at your project and, unless I'm missing something, I don't think you need to make it as complicated as you are doing.
Specifically, why do you need a separate table just for the 'editcounter' when it could simply go on the 'linkitems' table.
Have a look at the attachment.
Regards,
Derek.

Post's attachments

Attachment icon linkrefsave 2.zip 337.82 kb, 147 downloads since 2024-07-13 

Re: How to link selected grid rows to counter in different table?

derek wrote:

Hi,
I had a quick look at your project and, unless I'm missing something, I don't think you need to make it as complicated as you are doing.
Specifically, why do you need a separate table just for the 'editcounter' when it could simply go on the 'linkitems' table.
Have a look at the attachment.
Regards,
Derek.

Thank you Derek.
@derek I already tried that but that is not I want.
it creates 1 auto number per row.

What I want is a 1 reference number for filtered selected rows[can be one or more than one].

Take Invoice as an example one invoice number can reference one or more than one items in it.

0001 is link to 3 Item Below.

John - Item 1 qty - 5
John - Item 2 qty - 2
John - Item 3 qty - 1

If counter is not good way to do it, suggest me something which autoincrement and unique number.

Re: How to link selected grid rows to counter in different table?

In that case, simply use a 'header' table (with the 'counter') and then use another table to hold all the related line items.
Please see attached (I used one of my own templates as it was quicker to demonstrate but everything can be applied to your project / layout).
One other suggestion is to use just a single form to maintain your reference tables ('clients' and 'items'). In bigger projects where you might have many such reference tables or if your current project starts to grow,  it can be a big time-saver when developing it and your program will load faster.
Derek.

Post's attachments

Attachment icon kavina example.zip 439.35 kb, 185 downloads since 2024-07-13 

Re: How to link selected grid rows to counter in different table?

Hi,

i cannot find any example where 1 customer order many items and not repeat customer name in grid?
I attach screenshot.

sorry for my bad english.

Igor

Post's attachments

Attachment icon Screenshot_1.png 26.62 kb, 43 downloads since 2025-01-19 

Re: How to link selected grid rows to counter in different table?

Hi,
This is because the original requirement was for a job (jobheaders) that contained many items (joblines) and each job line could be for a different client.
What you are asking about is a job (jobheaders) that contains many items (joblines) but every job line is for the same client.
In this case, you can
1.  remove the relationship between client and joblines
2.  create a relationship between client and jobheaders
3.  adjust the tablegrids
4.  adjust Form2 and Form3
I believe these changes should give you the sort of thing you are wanting (see attachment).
It's okay if it's easier to post messages in your own language - most of us use 'google translate' anyway.
Regards,
Derek.

Post's attachments

Attachment icon igormad.zip 439.36 kb, 87 downloads since 2025-01-19 

Re: How to link selected grid rows to counter in different table?

Thank you for help
maybe this attachment will be more precise.
1 order number 1 customer but 2 or more items he ordered in same tablegrid thats what i was thinking.

ORDER NUMBER / CUSTOMER /   ITEMS   /  QUANTITY
        1                 /      Igor          /  Bottle     /        15
                            /                    /    Mug    /        10
        2                  /      Marko     /  Pencil   /         5


I start to make simple app for single user in my small family company so i will send  it when i stuck smile and probably i will.

maybe somewhere in forum have example for that but i cannot find it.

Thank you

Post's attachments

Attachment icon Screenshot_4.png 36.37 kb, 43 downloads since 2025-01-19 

Re: How to link selected grid rows to counter in different table?

Hi,
I suspect from your screenshot that you are using a spreadsheet and although it might look how you want to see it (because you have removed the repeated data) if you ever need to re-sort your spreadsheet, you will encounter problems.
With a relational database (such as sqlite which is the default database used by MVD) data is typically presented in two or more tablegrids to avoid repeated data being displayed.  Putting all the data in a single tablegrid can be done but will result in certain pieces of information being repeated (ie Order No, Customer etc).
Have a look at the attachment for how it works.
Derek.

Post's attachments

Attachment icon igormad2 (2).zip 440.33 kb, 155 downloads since 2025-01-20 

Re: How to link selected grid rows to counter in different table?

Thank you Derek,

ill go try with your advice,

should i post my work here or should make new topic for my work?

Re: How to link selected grid rows to counter in different table?

Hi,
Probably better if you can create a new topic.
Derek..