Link to home
Start Free TrialLog in
Avatar of Laurie V
Laurie V

asked on

VBA On Load User Type Not Defined error

Option Compare Database

Dim RS As ADODB.Recordset

Private Sub Form_Load()
Dim RS As ADODB.Recordset

Set RS = New ADODB.Recordset
RS.Open Me.RecordSource, CurrentProject.Connection, adOpenStatic, adLockOptimistic
If RS.RecordCount = 0 Then
    MsgBox "There are no existing records to edit! Please go to the add form to create some!"
DoCmd.Close
End If
RS.Close

End Sub

I get error messgae user defined type not defined?
SOLUTION
Avatar of Juan Ocasio
Juan Ocasio
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Laurie V
Laurie V

ASKER

Thanks!!!