I have a form that has a combo box. I want to use the combo box selection to populate the form. The problem seems to be that the Field that the combo box is using is in the form of A-12345. One letter, a hyphen and 5 numbers. I have tried a few different methods that have worked in the past but it doesn't work.
Here are the details:
The form is bound to a query. The combobox is populated by a query that pulls the IDNum from the table that the form is based on. I have the on update event of the combo box:
Private Sub cmbID_AfterUpdate()
Me.FilterOn = True
Me.Filter = "IDNum=" & Me.cmbID
Me.Requery
End Sub
When this is run, I get an popup that says to enter the Parameter Value and has the first character listed.
The other method I used was:
Private Sub cmbID_AfterUpdate()
If IsNull(cmbID) Then Exit Sub
Me.RecordsetClone.FindFirst "[IDNum] = " & Me![cmbID]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
And when this runs I get an error that states "The Microsoft Jet Databse engine does not recognize 'A' as a valid field name or expression. Where 'A' is the first character in the IDNum. I am sure it probably has something to do with quotation marks...If that is the case is there somewhere that explains how to use them? I have seen some wierd ways of quotes to make things work. Whichever method is easier will work for me...
Thanks
Here are the details:
The form is bound to a query. The combobox is populated by a query that pulls the IDNum from the table that the form is based on. I have the on update event of the combo box:
Private Sub cmbID_AfterUpdate()
Me.FilterOn = True
Me.Filter = "IDNum=" & Me.cmbID
Me.Requery
End Sub
When this is run, I get an popup that says to enter the Parameter Value and has the first character listed.
The other method I used was:
Private Sub cmbID_AfterUpdate()
If IsNull(cmbID) Then Exit Sub
Me.RecordsetClone.FindFirst "[IDNum] = " & Me![cmbID]
Me.Bookmark = Me.RecordsetClone.Bookmark
End Sub
And when this runs I get an error that states "The Microsoft Jet Databse engine does not recognize 'A' as a valid field name or expression. Where 'A' is the first character in the IDNum. I am sure it probably has something to do with quotation marks...If that is the case is there somewhere that explains how to use them? I have seen some wierd ways of quotes to make things work. Whichever method is easier will work for me...
Thanks