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

problem with Do Loops

Status
Not open for further replies.

plutz

Technical User
Oct 4, 2003
21
US
I have a database that i am try to loop through a table (maillist)of email address to send out different reports based on the field [deptid]. can you help

Dim project
project = Deptid
Do Until maillist.EOF
If project = 1 Then
DoCmd.SendObject acSendReport, "rptcalendar1", acFormatSNP, RP_email, , , "test", , False
ElseIf project = 2 Then
DoCmd.SendObject acSendReport, "rptcalendar2", acFormatSNP, RP_email, , , "test", , False
End If
maillist.MoveNext
Loop
 
That's Visual Basic code not Transact-SQL. You need to post in the proper forum. Microsoft SQL Server (this forum) uses Transact-SQL not VB.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top