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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADODB.Recordset - User-defined type not defined 1

Status
Not open for further replies.

Castanz

Programmer
Apr 5, 2002
61
US
I am not sure what I am doing wrong. I am trying to get data from a few different queries and post the results to one report. I can't get past the first statement: "Dim rst As ADODB.Recordset".

I get compile error: "User-defined type not defined"

I appreciate any advice.

Code:
Private Sub Report_Load()
Dim rst As ADODB.Recordset
Dim strCriteria As String
Dim StartDate1, EndDate1 As Date
Dim passengintot As Integer 'Passenger in total

Me![Date1] = Forms![Datechoice_frm]![StartDate_selected] set critaria
passengerintot = 0
Set rst = New ADODB.Recordset

strCriteria = "[Date-in] => #" & StartDate1 & #' And [Date-in] =< #" & EndDate1 & "#"

With rst
    Set .ActiveConnection = CurrentProject.Connection
    .Source = "Main_tbl"
    .CursorLocation = adUseClient
    .LockType = adLockBatchOptimistic
    .CursorType = adOpenKeyset
    .Open  
    .Find strCriteria
    Do While Not .EOF
        passengintot = passengintot + .Fields("Passenger-in")
    Loop
    '.UpdateBatch (no need to update)
End With
rst.Close
Set rst = Nothing
Me.Date1pass_in = passengerintot
End Sub
 
The link helped. I ended up loading a different version of Microsoft Active X.

Thanks,
Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top