update query is autorun when an associated field is changed

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

Guest

I would like to know how to accomplish the following two things:

1: Automaticall run the update query when a value changes in an associated
field.

2: When a mailing list is run, the ID is printed instead of the actual word.
I created a drop down box that updates itself based on another field. i.e
State field changes based on a Country. The State Id is printed not the state
it self. I can se the correct state when I look at the table, the printout is
wrong. What can I do?
 
Access doesn't have triggers, which is what you'd need for your first
question. If you're updating through a form, though, you can always add
logic in the form's BeforeUpdate event (or in the specific field's
AfterUpdate event).

For your second question, it sounds as though you're using a Lookup Field,
which few of us recommend (see http://www.mvps.org/access/lookupfields.htm
at "The Access Web" for a summary of some of the reasons why). Try creating
a query that joins your main table to your State table, and use the query
rather than the table.
 
1. On the after update event of the field you can run the query
docmd.openquery "QueryName"

2. You probably should select another column in the list box

Me.ListBox.column(1)

The column number strat with 0, if no column define it takes the value from
column 0, the first column in the Sql of the list box
Try and change the numbers until you get the right value
 
Back
Top