Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-13-2009, 07:16 AM
jesika jesika is offline
Spammer
 
Join Date: 25 Feb 2009
Location: U.S
MS Office Version:Outlook
Posts: 67
jesika is becoming part of the community
Getting problem in VBA

Please Register to Remove these Ads

Hi all,

I am getting problem in passing variables to a query
I've created a loop to run through all the clients in a table to generate their invoices.

How can I pass the client's ID to the query which is used in generating the report? Both reports call the same query. The query currently works fine when prompting for the ID to be entered manually.

currently have:

Code:
Private Sub Command9_Click()

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim fd As DAO.Field

Set db = CurrentDb()
Set rs = db.OpenRecordset("t_Clients")


rs.MoveFirst
Do While Not rs.EOF
' add something about the Clients ID <-----
If rs!credit_card Then
Generate_Invoice ("R_invoice_generate")
Else
Generate_Invoice ("R_inv_gen_wid_Ccard")
End If
rs.MoveNext
Loop

End Sub
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump