Issue on Print Out (1 Viewer)

sandya

Registered User.
Local time
Today, 19:49
Joined
Oct 27, 2013
Messages
82
Can anyone Help on My Print Problem :confused:

i have created a report on Query details based for print purpose

they details are:

Query Names : Customer Credit Transactions, Customer Credit Transactions Filter
Form Name : Customer Credit Transactions
Report: : 'CustomerCreditTransactionsReport' this report created above Query Details based.

So now i need to print from Form: Customer Credit Transactions i have a created a Print command and given below VBA Code for print purpose
------------------------------------------------------------------
Private Sub Print_Click()
' This code created by Command Button Wizard.
On Error GoTo Err_Print_Click

Dim strDocName As String

strDocName = "CustomerCreditTransactionsReport"
' Print Invoice report, using Invoice Filter query to print
' invoice for current order.
DoCmd.OpenReport strDocName, acViewNormal, "Customer Credit Transactions Filter"

Exit_Print_Click:
Exit Sub

Err_Print_Click:
' If action was cancelled by the user, don't display an error message.
Const conErrDoCmdCancelled = 2501
If (Err = conErrDoCmdCancelled) Then
Resume Exit_Print_Click
Else
MsgBox Err.Description
Resume Exit_Print_Click
End If
End Sub
-----------------------------------------------------------------------
so above code is working is good but all details are come's into print out pages. i need to Print only which i selected the customer details. I have attached the Form & report screen shots can anyone replay how to do changes.:confused:
--
Sandhya
 
Last edited:

sandya

Registered User.
Local time
Today, 19:49
Joined
Oct 27, 2013
Messages
82
a little bit confused how to apply this expression.

expression.OpenReport(ReportName, View, FilterName, WhereCondition, WindowMode, OpenArgs)

DoCmd.OpenReport "Qry3Report", acViewNormal, "Qry3 Filter" this is got it and next WhereCondition, WindowMode, OpenArgs i can't understand bold functions. i mean which details are replaced in bold places?? if any form details or query details?? :(

_______
Sandhya
 

AlexHedley

Registered User.
Local time
Today, 14:19
Joined
Aug 28, 2012
Messages
171
You don't need to supply all the arguments, I just added it for reference.
http://msdn.microsoft.com/en-us/library/office/aa141526.aspx

DoCmd.OpenReport "CustomerCreditTransactionsReport", acViewNormal, "Customer Credit Transactions Filter"

You could change this to use a WHERE condition instead:
DoCmd.OpenReport "CustomerCreditTransactionsReport", acViewNormal, , "WHERE CONDITION"

You could use the unique number in your Table, just get it from the Selected Record on your Form and use that in your WHERE condition.

Alex
 

sandya

Registered User.
Local time
Today, 19:49
Joined
Oct 27, 2013
Messages
82
DoCmd.OpenReport "CustomerCreditTransactionsReport", acViewNormal, "Customer Credit Transactions Filter"

this code is working as same
all customer details are come in print out pages. i need to print only selected customer details.

I think no need to give a Unique number in whereCondition because 3 types of tables merge in UNION Qry. after i have created the Report on Union Qry based(
Customer Credit Transactions)and also (Customer Credit Transactions Filter) both of union Query's.

So mostly i need Customer wise details not a
Unique number wise. or if its a important Unique number?? then 3 tables are merge in union query. then how to use Unique number??:confused:

Thanks,
Sandhya.
 

AlexHedley

Registered User.
Local time
Today, 14:19
Joined
Aug 28, 2012
Messages
171
What is your Filter?

Unique Value isn't necessary, I didn't realise you were after multiple value.

For Example: You can use a WHERE clause that gets all Customers called Fred.

Say you had a table of Customers with States and you wanted all Customers from New York.
WHERE State = 'NY'
 

sandya

Registered User.
Local time
Today, 19:49
Joined
Oct 27, 2013
Messages
82
Yes my filter is Customer in Customer Credit Transaction Form.

DoCmd.OpenReport "CustomerCreditTransactionsReport", acViewNormal, , "Customer"

i tried above code but its not work for selected customer wise.

am not sure if Unique Value isn't necessary. but i understand the where condition. but my database is prepared with some union query's so i confused how to give a code.

if you don't mine can you please check once my database file i have attached the zip file. please its request:eek:

i just rename the Query name's
Query's : Customer Credit Transactions As [Qry3], Customer Credit Transactions Filter As [Qry3 Filter]

please open in the Forms: Customer Credit Transactions
Select any customer and give a print. after then you will understand.

Thanks,
Sandhya.
 
Last edited:

sandya

Registered User.
Local time
Today, 19:49
Joined
Oct 27, 2013
Messages
82
Hello Alex,
Can you please replay.
 

JHB

Have been here a while
Local time
Today, 15:19
Joined
Jun 17, 2012
Messages
7,732
Replace the code line you have with the below code line.
Code:
    DoCmd.OpenReport "CustomerCreditTransactionsReport", acViewNormal, , "Customer='" & Me.Customer_Credit_Transactions_Subform.Form.Customer & "'"
 

sandya

Registered User.
Local time
Today, 19:49
Joined
Oct 27, 2013
Messages
82
Thank you so much and am very happy to your help. :) above code is working perfectly.
 

JHB

Have been here a while
Local time
Today, 15:19
Joined
Jun 17, 2012
Messages
7,732
You're welcome, luck with your project.
 

Users who are viewing this thread

Top Bottom