Run Time Error 3070

jamesgtierney

Registered User.
Local time
Today, 12:52
Joined
Jan 28, 2016
Messages
24
I am setting up a custom record selector from fontstuff.com and am having a problem.
I think the problem is that the primary key (CustomerId) is not an autonumber and contains text.
here is the code:

Private Sub cboGoToRecord_AfterUpdate()
On Error Resume Next
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "CustomerId = " & Me.cboGoToRecord.Value
Me.Bookmark = rst.Bookmark
End Sub

Can Anyone help
Thank you in advance
 
If it is text then:
Code:
rst.FindFirst "CustomerId = [B][COLOR=Red]'[/COLOR][/B]" & Me.cboGoToRecord.Value [B][COLOR=Red]& "'"[/COLOR][/B]
 
Private Sub cboGoToRecord_AfterUpdate()
On Error Resume Next
Dim rst As Object
Set rst = Me.RecordsetClone
rst.FindFirst "CustomerId = " & Me.cboGoToRecord.Value
if Not rst.NoMatch Then
Me.Bookmark = rst.Bookmark
End If
End Sub
 
You're welcome, good luck. :)
 

Users who are viewing this thread

Back
Top Bottom