View Full Version : Find record based on values in both form and subform


Jon.N
07-23-2001, 05:02 AM
Help!!! I would like to make a form open based on two values. One value is in the form and the other value is in one of the subforms. Any ideas will be gratefully received.

Rich@ITTC
07-23-2001, 05:45 AM
Hi Jon.N

I don't really understand what the problem is ... assuming your subform and main form are linked with the correct shared field in the Child/Parent links, won't opening the main form at the correct record automatically bring about opening the subform with the required associated record(s)?

Perhaps I have not understood what you are trying to achieve.

Rich Gorvin

charityg
07-23-2001, 06:45 AM
when building the strCriteria just following the naming conventions to refer to the values you want

Like

strLinkCriteria="[field1]='" & forms!mainform!field1 & "' and [sfield2]='" & forms!mainform!subform!field2 & "'"

Jon.N
07-25-2001, 12:27 AM
Many thanks for your help - problem solved. The relationship between the master form and the subform is a one-to-many relationship. I needed the form, upon opening to find a particular record in the main form (a name)and a particular record in the sub form (a date) which is a starting point and then allow the user to navigate through the records in the subform.