need help with lookup table to populate combobox

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

Guest

Hello all, I have been trying to glean what I need to off the other posts,
but haven't gotten it right yet. I have a form that I want to first select a
value from my MGMT combobox (these codes are also in another table as the
many part of the 1-to-many relationship), and then in another combobox called
Site Name, only return the Site Names that also have that value in the lookup
table (i.e. in the MGMT field, LWMD is selected, I want to have only the
sites from LWMD able to be selected in the Site Name combobox). I have done
this with relative ease using VB script for use in ArcPad, a GPS program, but
can't seem to get it in Access. I would like it to update the Site field (in
the main table) pick list after the MGMT field is selected ie in the On
Change event.

form name: Main_plover_form
lookup table: Sites Table
lookup field: Site Name
Criteria would be the value of MGMT in the Main_plover_form=MGMT in the
Sites Table.

Any help would be appreciated,

Adam
 
open your form in design view. click on the Site Name combo box to select
it. in the Properties box, look at the RowSource property. assuming that
your RowSource is a SELECT statement, add a WHERE clause, as

WHERE NameOfMGMTField = Forms!OpenFormName!MGMTComboBoxName

substitute the correct field, form and control names, of course.

in the MGMT combobox, add a requery command to the AfterUpdate event, as

Me!NameOfSiteNameComboBox.Requery

again, substituting the correct control name.

hth
 
Back
Top