variable not defined...

mfuada

Registered User.
Local time
Today, 14:41
Joined
Feb 4, 2009
Messages
63
hi guys i get a error message like this: "Compile error:variable not defined"
and here's my code:
Private Sub Command36_Click()
Set reop_db = CurrentDb().OpenRecordset("reop_fixed") ->highlited by VBA
reop_db.AddNew
reop_db!date_reop = Me!reop_datetxt
reop_db!series = Me!series_reoptxt
reop_db.Update
End Sub


i wrote the same code on the other form to put in to different table (not "reop_fixed") and it's working just fine....
could anybody tell me why?
 
Remove the brackets from the CurrentDb().OpenRecordset command
 
i'm sorry i have removed the brackets but still getting the same error message :variable not defined,actually VBA highlited this part of the code: "Set reop_db ="
 
i've tried to set "Dim reop_db As Recordset" at the top of the code and it works...
thx anyway...
 
Have you not defined your recordset yet

Code:
Dim reop_db As DAO.Recordset
 

Users who are viewing this thread

Back
Top Bottom