Another combo box question

puakenikeni

Registered User.
Local time
Today, 00:15
Joined
Jun 24, 2008
Messages
25
I'm trying to create a form and a its child subform so that when you select a value in the combo boxes in the main form, the records corresponding to the choices in the combo box will show in the subform. However, I'm running into problems with the first combo box. If I make any choices from the combo box, I have this error message:

Code:
Run-time error '3070':
The Microsoft Jet database engine does not recognize 'WARS' as a valid field name or expression

This is what I have in my code for the "After update" event of the combo box:

Code:
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[ProgramName] = " & Me.cboProgramName_tab2
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Me.Repaint
Me.subMaster.Requery

Did I write the code incorrectly? Am I referring to the field incorrectly?
 
Your syntax tells Access that Me.cboProgramName_tab2 is numerical, and I'm guessing that it's actually text. If this is so, the syntax would be:


rs.FindFirst "[ProgramName] = '" & Me.cboProgramName_tab2 & "'"
 
Thank you very much! That was exactly it. I was thinking that I was using the wrong data type, but I wasn't sure how to code it.
 

Users who are viewing this thread

Back
Top Bottom