By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,930 Members | 1,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,930 IT Pros & Developers. It's quick & easy.

Populate Form and Subform based on Search criteria

P: 22
Hi,

I have a form with a subform, Both of them are based on a query.the form displays a productid and its details ,and the subform has matching productnames for that productid.

Now i have a search on the main form wherein the user enters ( search for) the productid, once they click search button, the form should show that particular prod id and details and subform loaded accordingly with that productid matches...seems simple but how do i code this in VBA??

Basically populatuing the form and subform with data based on search..

i am using ODBC coonxn with backend oracle tables..

any help would be highly appreciated!

Thanks!
Mar 2 '07 #1
Share this Question
Share on Google+
1 Reply


nico5038
Expert 2.5K+
P: 3,072
As long as the subform needs to show only the related productnames, you don't need code as Access will synchronize the subform for you when the linakge fields are set.
Just open the mainform in design mode and single-click the subform.
Now open the properties form (press button with hand and white sheet) and look under the Data tab.
It will show a master and child "linkage field" parameter. Enter the controlname of the main form in the Master linkage field and the controlname of the subform in the child linkage field. Now Access will do the work.

Finally add a new combobox to your mainform and select the third option (search a record). This will allow your user ro select a product and jump to the data of the selected rpoduct.

Nic;o)
Mar 3 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.