Update two fields in table via input form list or combo box

  • Thread starter Thread starter Steven R via AccessMonster.com
  • Start date Start date
S

Steven R via AccessMonster.com

I have an input form for contracts for a purchasing dept - when the data
input person inputs the contract, they need to select a buyer. Each buyer
works for a specific work group - my field names are "BUYER" and "GROUP" - I
wanted to type in the buyers and their associated work group (there are not
that many) so when the user clicks the buyer, it will also populate the GROUP
field in the underlying table as well.

Do I have to select "Store the value for later use" when using the list box /
combo box wizard, and do some coding, or is there some other easier way ?
 
Presumably, the Buyer's current Group is stored in the Buyers table?

If so, then put a DLookup of the Buyer's current group in the
Buyer_AfterUpdate, something like this:

Private Sub Buyer_AfterUpdate()
Group = Dlookup("[Group]","[Buyers]","[Buyer] = '" & [Buyer] & ''")
End If

This assumes Buyer is text, if it is numeric, adjust the syntax (quotes).
 
Back
Top