thingssocomplex
Registered User.
- Local time
- Today, 00:38
- Joined
- Feb 9, 2009
- Messages
- 178
I have table that contains Employee Name and Email; I have a query that includes 'Employee Name'; I have user form with two text boxes named txtname and txtemail. Within the query criteria for 'Employee Name' I have added [Forms]![Control]![txtname]
I also have a button with the below code however I cannot get this to run can anybody please assist me with making the below code work?
I also have a button with the below code however I cannot get this to run can anybody please assist me with making the below code work?

Private Sub Command4_Click()
Dim MySet As DAO.Recordset
Set MySet = New DAO.QueryDef
MySet.OpenRecordset "Example", CurrentDb.Connection
Do Until MySet.EOF
[Forms]![Control].[qadviser].Value = MySet![AdviserName]
[Forms]![Control].[qemail].Value = MySet!
DoCmd.SendObject acSendQuery, "Example", "MicrosoftExcel(*.xls)", [Forms]![Control].[qemail]
MySet.MoveNext
Loop
End Sub
[/QUOTE]