Combo Box Syntax Error

S

schuh.mike

I am trying to use a combo box to select a specific schedule for a specific
student, and then load that schedule onto the form.

My combobox is populated with this query:
SELECT tblSchedules.term FROM tblSchedules WHERE
(((tblSchedules.userName)=txtUserName));

The WHERE clause is avoiding seeing every single "term" record, only the
ones pertaining to the specific user.

When I run this, I got an error saying:
Run-time error '3077'
Sytax error (missing operator) in expression.

Here is the code for the combo box: (created by a wizard)

Private Sub Combo72_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[term] = '" & Me![Combo72] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The error is dealing with the line: "rs.FindFirst...."

Any help would be greatly appreciated!
 
O

OfficeDev18 via AccessMonster.com

Try changing

Me![Combo72]

to

Me.[Combo72]
(period, not bang).

That should fix it.

Sam

schuh.mike said:
I am trying to use a combo box to select a specific schedule for a specific
student, and then load that schedule onto the form.

My combobox is populated with this query:
SELECT tblSchedules.term FROM tblSchedules WHERE
(((tblSchedules.userName)=txtUserName));

The WHERE clause is avoiding seeing every single "term" record, only the
ones pertaining to the specific user.

When I run this, I got an error saying:
Run-time error '3077'
Sytax error (missing operator) in expression.

Here is the code for the combo box: (created by a wizard)

Private Sub Combo72_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object

Set rs = Me.Recordset.Clone
rs.FindFirst "[term] = '" & Me![Combo72] & "'"
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub

The error is dealing with the line: "rs.FindFirst...."

Any help would be greatly appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top