Conditional combo box to find record

AnilBagga

Member
Local time
Today, 13:26
Joined
Apr 9, 2020
Messages
223
I have a main form A and sub form B setup and need to search for a record in the sub form using a cbo say F placed in the header of the sub form. The Master form and sub form link fields are A1 and B1

I want to locate a record in the sub form by searching the value in the field C of the form source table D (see screen shot below). This value is located in the sub form cbo with control name cboC.

Since the table D does not have unique values in field C, a simple cbo record look up using the wizard does not do the job. The additional condition is that the the field B1 of sub form should be equal to the main form A's value A1

Also the search list of cbo F should only show the records where the B1 of Sub form = A1 of the Main form and the search should list should be sorted in ascending order of the value of C

Is this possible to configure? I am a beginner with very sparse knowledge of vbA and have used only control wizard supported cbo so far. I located some vbA for this search but none uses a conditional search and tweaking the code did not help.

1621493130455.png
 
in short you want to search FGCode?
 

Users who are viewing this thread

Back
Top Bottom