query recordset

mlswyo

Registered User.
Local time
Today, 03:30
Joined
Jun 5, 2011
Messages
12
I'm new at this but have managed to get a recordset using the following:

Private Sub cmdRunM1_Click()
On Error GoTo Err_cmdRunM1_Click
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim qdf As DAO.QueryDef
Set db = CurrentDb()
Set qdf = db.QueryDefs("Query1")
qdf(0) = [Forms]![form1]![Text1]

Set rs = qdf.OpenRecordset(dbOpenDynaset)

MsgBox qdf.Name & ":" & rs!TrainingID & " " & rs!EmployeeID & " " & rs!CourseID

Exit_cmdRunM1_Click:
Exit Sub

Err_cmdRunM1_Click:
MsgBox Err.Description
Resume Exit_cmdRunM1_Click

End Sub

How do I now get this information into a form so that I can work with the data?

tks,

mlswyo
 
You can just simply change the record source of a form to your dao.recordset by using something like me.recordsource = rs

TheChazm
 

Users who are viewing this thread

Back
Top Bottom