error (1 Viewer)

Purdue22

Registered User.
Local time
Today, 19:10
Joined
May 11, 2001
Messages
25
I am getting an, "Operation is not supported for this type of object", error when I try to execute the code below. The line that it stops on is:
rst.Findfirst"[dealer]='" & Dealer &"'"

Any suggestions?


Private Sub Dealer_AfterUpdate()
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("Dealer Info")
rst.FindFirst "[dealer]='" & Dealer & "'"
With rst
If .NoMatch Then
MsgBox "Dealer not found!"
Else
Me!fax = !fax
Me!tc = !tc
Me!phone = !phone
End If
End With
End Sub
 

charityg

Registered User.
Local time
Today, 19:10
Joined
Apr 17, 2001
Messages
634
is the name of your field in the table dealer? and is the name of the combo box Dealer? if so, this should work. if you're still having problems, could you email me the database to take a look at?
 

charityg

Registered User.
Local time
Today, 19:10
Joined
Apr 17, 2001
Messages
634
The problem was a different issue, but for anyone interested, the problem with the code was
Set rst = db.OpenRecordset("Dealer Info")
should have been:
Set rst = db.OpenRecordset("Dealer Info",dbopendynaset)
 

Users who are viewing this thread

Top Bottom