[RESOLVED] Help in Data Report
Is it possible that I can create a transaction receipt just by using data report? From the example that I've seen it seems that the report displays a list. I just need one row/record from the database (I'm using MS Access and SQL) containing the Payment No, Payment and payment type to create the receipt. Is it also possible that one report can use two different sets of database table? For example one textfield has a different datasource from another textfield.
Re: [RESOLVED] Help in Data Report
Alright I have another problem, I've used the code and it works but only in the first time. In the commands in the data environment I've inputted "SELECT * FROM payment WHERE ID = ?", named ? as param1. Then on the click eventI used this code
Code:
DataEnvironment1.Commands("payment").Parameters("param1").Value = frmPayment!txtPayNo
DataReport1.Show vbModal
The datareport displays what I intended the first time (for example If the textbox has "1" in it displays the columns with ID "1" from the payment table, but when I click again and this time the textbox displays "2", the report still displays the columns with ID "1".
Re: [RESOLVED] Help in Data Report
You have to close the recordset or requery,
Code:
If deCropbyuser.rsCommand1_Grouping.State = adStateOpen Then
deCropbyuser.rsCommand1_Grouping.Close
End If
Put this just before you set the param1 and run the report, I guess you could close the recordset right after you run the report.
Re: [RESOLVED] Help in Data Report
^ It works, however there's still a problem, cause my VB seems to be working strangely. Whenever I put a breakpoint right before the DataReport shows, the info I need displays on the DataReport. But if I clear the breakpoint (there's no breakpoint at all), the DataReport just displays blank. What seems to be the problem?
Re: [RESOLVED] Help in Data Report
I'd guess you are putting the data in a table just before you run the report. ACCESS has a delay before it writes the data. I found that closing the recordset and connection before running the report helps.