ralphralph07
MIS
Hi
I have a report that i have inherited from an old database that i have upgraded from 97. The report somehow used to print out the last audit that was completed and print the details but since upgrading the database this no longer works.
I would like the report to prompt for the lab reference before printing the report to ensure that the correct information is printed but i can't seem to get it to work.
The report is based on a table and then code behind to pull through the rest of the information.
There is quite a bit of code relating to the report so i think i may be putting it in the wrong please?
Any help on shedding some light on this greatly received.
Ralph
I have a report that i have inherited from an old database that i have upgraded from 97. The report somehow used to print out the last audit that was completed and print the details but since upgrading the database this no longer works.
I would like the report to prompt for the lab reference before printing the report to ensure that the correct information is printed but i can't seem to get it to work.
The report is based on a table and then code behind to pull through the rest of the information.
There is quite a bit of code relating to the report so i think i may be putting it in the wrong please?
Code:
Private Sub print_Click()
Dim print_response As Integer
Dim cond As String, repname As String
cond = DLookup("[macroname]", "Report Names", "[reptitle]=forms![report screen].[reptitle]")
repname = DLookup("[repname]", "Report Names", "[reptitle]=forms![report screen].[reptitle]")
On Error Resume Next
DoCmd.OpenReport repname, A_NORMAL, , cond
DoCmd.SetWarnings False
On Error GoTo 0
If [reptitle] = "Report Analyses" Then
print_response = MsgBox("Do you want to mark these Analyses as Printed ?, Y/N", 292, "Analysis Printout")
If print_response = 6 Then DoCmd.OpenQuery "update print flag"
End If
If [reptitle] = "sample logging audit trail" Then
print_response = MsgBox("Do you want to Update the logging audit file ?, Y/N", 292, "Analysis Printout")
If print_response = 6 Then DoCmd.OpenQuery "update audit print flag"
End If
DoCmd.SetWarnings True
End Sub
Any help on shedding some light on this greatly received.
Ralph