Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save code for Form 1

Status
Not open for further replies.

cneill

Instructor
Mar 18, 2003
210
GB
Hi Evertyone.

I have used this code on many forms without a problem

Option Compare Database
Option Explicit

Dim Data As Recordset

Various Code.....
Set Data = CurrentDb.OpenRecordset("tblMain", , dbPessimistic)

With Data
.AddNew
Various bits of code

On the new form I am getting Compile error variable not defined and the dbPessimistic is highlighted

Can anyone point me in the right direction as to what is causing this?

Thanks

CNEIL
 
Dim Data As [!]DAO.[/!]Recordset

BTW, did you reference the Microsoft DAO library ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV

Forgot to ref the Library in the new Database, know what the problem is now.

Thanks

CNEILL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top