Autoexpand

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


robott said:
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?
 
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

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html


robott said:
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.
 
Back
Top