Karsten
09-28-2000, 10:36 AM
Hello all! I was hoping I might get some help on this...
In the code module of an Access form I have a command button that runs the following code:
___________________________________
Private Sub cmdQuery_Click()
Dim db As Database
Dim NoEMails As QueryDef
Set db = CurrentDb
Select Case optRecipients
Case 1
Set NoEMails = db.CreateQueryDef("")
NoEMails.SQL = "SELECT (sql goes here)"
'Set recNoEmails = NoEMails.OpenRecordset
Case 2
...
End Select
db.close
Set db = nothing
___________________________________
How do I display the results of the temporary querydef? I don't want to save the query and do an .openquery. I'm stuck on this --- any help?
Thanks!
In the code module of an Access form I have a command button that runs the following code:
___________________________________
Private Sub cmdQuery_Click()
Dim db As Database
Dim NoEMails As QueryDef
Set db = CurrentDb
Select Case optRecipients
Case 1
Set NoEMails = db.CreateQueryDef("")
NoEMails.SQL = "SELECT (sql goes here)"
'Set recNoEmails = NoEMails.OpenRecordset
Case 2
...
End Select
db.close
Set db = nothing
___________________________________
How do I display the results of the temporary querydef? I don't want to save the query and do an .openquery. I'm stuck on this --- any help?
Thanks!