FindRecord between forms?

  • Thread starter Thread starter Solus
  • Start date Start date
S

Solus

Guest
I am trying to select the record by using a value from my first form. I have
created two forms that both use the same table.

The first form has a listbox and an image. The listbox contains the names of
all the planes in my table and the image shows the respective picture for the
plane. When you double click the image, it opens the second form.

The second form has all the details about the plane, except for the image.
The problem is getting the second form to display the correct record.

How do I select the correct record based on the listbox value in the first
form?


I have tried using a macro that contains the action gotocontrol and setting this to the plane_ID (which is my primary key) on the second form followed by FindRecord which points to the listbox from the first form but this doesn't seem to work.

Thanks in advance
-Solus
 
ok
do the following

base the second form which has all the details on a query. Give the criteria on the field with which your first form listbox is based on.

forexmaple

your listbox has field
planeid
planename

in the query put thefollowing criteria in the planeid field

[forms]![Listboxformname]![listboxname]

now when you will open your listbox form and double click yoiu image this would run the criteria field and open the form which is selected in teh listbox

i hope this would work for you as it works for me
 
hmm... so instead of basing the second form on the table, base it on the query which is generated from what is selected in the first form?

I'll give that a try. If it works, I would still like to know if it's possible to do it the way I was trying.

Thanks
 
mohammadagul said:
ok
do the following

base the second form which has all the details on a query. Give the criteria on the field with which your first form listbox is based on.

forexmaple

your listbox has field
planeid
planename

in the query put thefollowing criteria in the planeid field

[forms]![Listboxformname]![listboxname]

now when you will open your listbox form and double click yoiu image this would run the criteria field and open the form which is selected in teh listbox

i hope this would work for you as it works for me

Ok thanks. I tried this and it does work. Just changed the form to look for the query and it works fine :D
 

Users who are viewing this thread

Back
Top Bottom