Combo box selection writes to two places

  • Thread starter Thread starter Maggie
  • Start date Start date
M

Maggie

I have a combo box that looks up a value from the field PK
in my EventTable. Once a value is selected I want the
combo box to lookup & write the value of two other fields
in my Event table to fields Category and Subcategory in
MainTable.

Example
If PKField = A1 then Event = A and Location = 1 write
this event & location info to Category and Subcategory in
MainTable

Any suggestions on how to accomplish this?

Thanks,

Maggie
 
Hi,


I assume those tables/fields are not already bound to existing controls
in the form, right? You can always try the syntax:

CurrentDb.Execute "INSERT INTO tableName(listOfFields) VALUES(
listOfValues) ", dbFailOnError

to insert a NEW record, in the specified table, with the specified values
under the specified fields. The values, if not numerical, must have the
appropriate delimiters.

If you want to change the actual CONTROLS of the form, NOT appending a
new record in another table, then, in the after update event of the combo
box, use:


Me.OtherControl1 = Me.ComboBox.Column( 21 )


this would place the content of the 22nd column of the combo box ( its first
column has index 0 ) in the specified other control. Generally, combo box
have far less than 22 columns :-) that is just for illustration.


You can create the multiple columns combo box with the help of the control
wizard (adding a new combo box while the magic wand is "active").

Hoping it may help,
Vanderghast, Access MVP
 
Back
Top