lookforsmt
Registered User.
- Local time
- Today, 14:16
- Joined
- Dec 26, 2011
- Messages
- 672
HI! I am trying hard to get this accomplished but somehow not able to achieve. Perhaps doing something wrong.
Below is the code i have on my on click form to view the report and a msgbox that prompts me whether i want to print the report.
Can anyone help me and let me know what i am doing wrong.
thanks
Below is the code i have on my on click form to view the report and a msgbox that prompts me whether i want to print the report.
Can anyone help me and let me know what i am doing wrong.
thanks
Code:
Private Sub cmd_Print_Click()
Dim strDocName As String
Dim strLinkCriteria As String
Dim myform As Form
Dim pageno As Integer
Dim i, p
pageno = Me.CurrentRecord
Set myform = Screen.ActiveForm
strDocName = "rpt_Data_Entry"
strLinkCriteria = "[SrId] = forms![frm_Data_Entry]![SrId]"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.SelectObject acForm, frm_Data_Entry, True
DoCmd.OpenReport strDocName, acViewPreview, , strLinkCriteria
If Me.Dirty Then
If (Me.SrId < 0) Then
Else
If MsgBox("Do you want to print this voucher?" & Chr(13) & _
"", vbYesNo, "Process Type") = 7 Then
Me.Undo
For i = 1 To p
Next i
Me.Requery
End If
End If
End If
End Sub