I have a form showing address records; a subform shows multiple block/lots. Can I make a combo box that will pull up the address record when I enter a block/lot?
Sure, in the AfterUpdate event on the control in which you select the
Lot/Block, set the combo's RowSource property to a query that only returns
the records you want. The following page demonstrates how: http://www.pacificdb.com.au/MVP/Code/ComboRS.htm
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Graham: Thanks for the reply. We're on the right track with the example you gave at http://www.pacificdb.com.au/MVP/Code/ComboRS.htm
My two drop-downs will be static - "block" and "lot" from the same table. But then I need the main form to repaint with data from a related table - like a form showing a list of invoices in your example
The event sequence would be: pick drop-down 1, then drop-down 2, then repaint main form.
In the AfterUpdate event for combo2, just filter the form's RecordSource
property:
Forms!frmMyMainForm.RecordSource = "SELECT * FROM tblMyTable WHERE x =
y"
....or requery the main form:
Forms!frmMyMainForm.Requery
whichever is appropriate in your situation.
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
The requery after update idea was the key. Thanks much Graham.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.