Hello:
I am trying to convert Access 97 basic to Access 2000 visual basic.
The following code is not converting, and returning an error on the line line that states:
Dim db As Database
"Compile Error."
"User-defined type not defined"
Here is the code.
Dim db As Database <<<---Here is the error in the code|||
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_visitor"
Dim newID As Integer
With rst
.AddNew
newID = !visitorID
!firstname = Me.TextFirstNameV.Value
!lastname = Me.TextLastNameV.Value
!employeefirstname = Me.TextFirstNameE.Value
!employeeLastname = Me.TextLastNameE.Value
!company = Me.TextCompany.Value
!Date = Now
!reasonforvisit = Me.TextVisitPurpose.Value
!agreedToTerms = True
.Update
.Close
End With
I am trying to convert Access 97 basic to Access 2000 visual basic.
The following code is not converting, and returning an error on the line line that states:
Dim db As Database
"Compile Error."
"User-defined type not defined"
Here is the code.
Dim db As Database <<<---Here is the error in the code|||
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_visitor"
Dim newID As Integer
With rst
.AddNew
newID = !visitorID
!firstname = Me.TextFirstNameV.Value
!lastname = Me.TextLastNameV.Value
!employeefirstname = Me.TextFirstNameE.Value
!employeeLastname = Me.TextLastNameE.Value
!company = Me.TextCompany.Value
!Date = Now
!reasonforvisit = Me.TextVisitPurpose.Value
!agreedToTerms = True
.Update
.Close
End With