Need Help in printing report with current data

First thing I did was copy your query in the report properties Data, Record Source to a new query and pasted.
I then added the field RemittanceID: [RemittanceUniqueID]
as the first field in the qry.
And I set the Criteria for this field to : [Forms]![RemittanceDetails]![RemitterUniqueID]

This links the field in your Form to the new field in your report.

To select the data for just one Remittance you MUST have the unique remittance ID in the query/report before any other steps can be taken.

I then set the reports datasource to the query. Really makes no difference if you have a separate query or a query actually in the report but for me I find it easier to edit and check when I deal with a query by it self.

Here is the sql query

SELECT RemittanceDetails.RemitterUniqueId AS RemittanceID, SenderDetails.SenderId, SenderDetails.SenderName, SenderDetails.SenderAddress1, SenderDetails.SenderPostalCode, SenderDetails.SenderCity, SenderDetails.SenderCountry, SenderDetails.SenderPhoneNo, BeneficiaryDetails.BeneficiaryId, BeneficiaryDetails.BeneficiaryName, BeneficiaryDetails.BeneficiaryCNICNo, BeneficiaryDetails.BeneficiaryAddress1, BeneficiaryDetails.BeneficiaryPostalCode, BeneficiaryDetails.BeneficiaryCity, BeneficiaryDetails.BeneficiaryCountry, BeneficiaryDetails.BeneficiaryPhoneNo, RemittanceDetails.RemitterKey, RemittanceDetails.RemitterUniqueId, RemittanceDetails.RemittanceDate, RemittanceDetails.RemittanceTime, RemittanceDetails.RemittanceCurrencyCode, RemittanceDetails.RemittanceAmount, RemittanceDetails.ExchangeRate, RemittanceDetails.LocalCurrencyCode, RemittanceDetails.LocalAmount, RemittanceDetails.RemittanceCharges
FROM (SenderDetails INNER JOIN BeneficiaryDetails ON SenderDetails.SenderId = BeneficiaryDetails.BenfSenderId) INNER JOIN RemittanceDetails ON BeneficiaryDetails.BeneficiaryId = RemittanceDetails.RemitterBenfId
WHERE (((RemittanceDetails.RemitterUniqueId)=[Forms]![RemittanceDetails]![RemitterUniqueID]));

Trust this assists
 
Thanks for the great work but I just downloaded the attached access file and tried to run it, now it is showing only one record in the print report preview but I feel you didn't check that the record it shows everytime is the first remittance record. try to change the remittance instead of 1st record to 5th or 6th record and then press preview report button, you will find that report is still showing the 1st record only.
 
I am on RemittanceDetails form and as I scroll through the form I see different Reference numbers .
200005, 200007, 200008, 200009, 200014, 200015 and 200016.

Which ever record I am on, if I click my Preview Report button I see a two page report only dealing with the remittance record that shows on the form at the time.

Haven't checked the other forms.

Advise which form is not working.
 
Here is the event procedure for the on click event for the report button:

Private Sub Command35_Click()
On Error GoTo Err_Command35_Click

Dim stDocName As String

stDocName = "RptRimittanceTest"
DoCmd.OpenReport stDocName, acPreview

Exit_Command35_Click:
Exit Sub

Err_Command35_Click:
MsgBox Err.Description
Resume Exit_Command35_Click

End Sub

You will see it refers to my RptRimittanceTest

You will need to edit this as you make your changes.
 
Yes I checked it. It is working fine on RemittanceDetails form but try to click the same button from the main form and you will find that it asks for the remittanceid and doesnt work. Also just to be sure that when you click the preview report button, does it take long to preview the report or it is just happening with me?
 
My Preview report button works instantly.

The other two forms are using your button that goes to your old report and query.

Have you tried to create a new button to my report and query but first rename them to what you prefer.

I will try and fix the other two forms up but.... you should make note of what is happening and edit this to suit your naming system etc.
 
RemittanceDetails works but although you have used this form as your subform in the two other forms it is no longer your form name in those forms.

The query is looking for the form RemittanceDetails.

We need more advanced skill to resolve this I have.

I will keep on it for a while but time is short.
 
Thanks a lot PNG... I solved other forms issue... I need to create separate query and report for each form and in each query I have to set criteria for RemittanceID for QrySender for SenderDetails form = forms!SenderDetails!BeneficiaryDetails!RemittanceDetails![RemitterUniqueId]

Thanks for your great help.... it is working now superb.... the delay was because the file you attached was in access 2000 format I just converted it back to 2007 format and now there is now delay in report preview....
 

Users who are viewing this thread

Back
Top Bottom