Code Issues

G

Guest

keep getting an error when I use the folloeing code. This code is a refresh
button that takes you back to the last record you were viewing when you
presses refresh. Please can some one help me. Below is the error type as
well as the code:
Error Type: Run-Time Error '3077
Syntax Error (missing Operator) in expression


Private Sub Refreshfrom_Click()
Dim strLCNumber As Variant 'To save the primary key

If Me.Dirty Then 'Save First
Me.Dirty = False
End If
strLCNumber = Me.strLCNumber

Me.Requery

If IsNull(strLCNumber) Then 'Must have been a new record
RunCommand acCmdRecordsGoToNew
Else
With Me.RecordsetClone
.FindFirst "strLCNumber= " & strLCNumber ' this is where I keep
getting the error.
If .NoMatch Then
MsgBox "Disappeared."
Else
Me.Bookmark = .Bookmark
End If
End With
End If
End Sub
 
R

ruralguy via AccessMonster.com

It is pretty easy to confuse Access if you name Fields, Controls and
Variables the same name.

Try:
.FindFirst "[strLCNumber] = " & strLCNumber
...and see if that helps. I would suggest you give each object a slightly
different name.
 

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