how to run a query based on a combo box value

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

Guest

I want to use AfterUpdate feature to run the query (displayed as a subform)
based on the value chosen in the combo box. What visual basic code do I need
to add?
 
For some reason it does not work. I have this code for AfterUpdate:

Private Sub Form_AfterUpdate()
Me!Subform_By_RCA.Form.Requery
End Sub

where Subform_By_RCA = name of the subform based on a query.
 
I entered this code for the combobox:

Private Sub RCA_AfterUpdate()
Me!Subform_By_RCA.Form.Requery
End Sub

but I'm getting this error:

Run time error 2465
Microsoft Access can't find the field 'Subform_By_RCA' referred to in your
expression.

Como box is based on a separate table that lists RCA names. Subform_By_RCA
is based on a query set up using 3 tables, including the table RCA names used
in combo box. Could that be a problem?
 
Back
Top