Hi,
I have spent much of my time creating form and have become versatile in form processing, etc. But now I have to create reports for the software that I am developing... and it looks like the learning curb is starting all over again. I have search the internet, but only get the basics of creating a report which I know how to do. Here is my situation...
I create a table of daily transactions, i.e. when user closes the business day it writes transactions to the transaction file. I then created a report menu and when a selection is made, I open a pop-up form when parameter selections. Based on the parameter selection, I do a search on the transaction file to ensure that there are records, if no records I give a message, if there are records I open the report passing the parameter selection that was enter. Code below:
Dim rs As DAO.Recordset
If Not IsDate(Me.FromDate) Then Me.FromDate = Date
If Not IsDate(Me.ToDate) Then Me.ToDate = Date
If strP1 <> "0" And strP2 = "0" And strP3 = "0" _
And strP4 <> "0" And strP5 <> "0" And strP6 <> "0" Then
strSQL = "SELECT * FROM tblCloseBusTrans WHERE [BefDepartment] = '" & Me.cboDept & "' AND " & _
"[BusDayDate] >= #" & Me.FromDate & "# AND " & "[BusDayDate] <= #" & Me.FromDate & "#"
strLinkCriteria = "[tblCloseBusTrans].[BefDepartment] = '" & Me.cboDept & "'" & _
"AND [tblCloseBusTrans].[BuyBusDate] >= #" & Me.FromDate & "#" & _
"AND [tblCloseBusTrans].[BuyBusDate] <= #" & Me.ToDate & "#"
End If
Set rs = DBEngine(0)(0).OpenRecordset(strSQL)
If rs.EOF = True Then
MsgBox "No Records for selected criteria"
strLinkCriteria = ""
Exit Sub
End If
rs.Close
Set rs = Nothing
DoCmd.OpenReport strForm, , , strLinkCriteria, , , strSndArgs & "," & strForm
When I Click the OK button, it pops up a messaging that it is printing the report to the printer and just hangs.
What I would like to do, is let the form first open in preview mode so that the user can see the report online and then decides whether they want to print the report or not. It must not print when I open the report, but open in preview mode.
Your help is much appreciated.
Thanks
Earl