You might be able to do a print command using the unique record id, I'm not sure what the code would be but I do something similiar where I open a report based on the current record. Here is my code:
Private Sub cmdOpenrptCheckRequestNew_Click()
On Error GoTo Err_cmdOpenrptCheckRequestNew_Click
Dim stDocName As String
'Opens new check request form without having to input check request id.
stDocName = "rptCheckRequestNew"
' DoCmd.OpenReport stDocName, acPreview
DoCmd.OpenReport stDocName, acPreview, , "[CheckRequestID]= " & Me.CheckRequestID
' Opens the reimbursement spreadsheet without having to input check request id.
stDocName = "rptCheckRequestReimbursementSpreadsheet"
DoCmd.OpenReport stDocName, acPreview, , "[CheckRequestID]= " & Me.CheckRequestID
Exit_cmdOpenrptCheckRequestNew_Click:
Exit Sub
Err_cmdOpenrptCheckRequestNew_Click:
MsgBox Err.Description
Resume Exit_cmdOpenrptCheckRequestNew_Click
End Sub
--- In MS_Access_Professionals@yahoogroups.com, jpjones23@... wrote:
>
> I'm not certain why or if the requirement is to actually display the form itself along with its data, but if this is the case, a screen print of the open form saved as a *.jpg file and then placed on a report page inside an image control will allow the form to show up on the report along with its data. I've done this with various state mandated forms and it worked well. I used label or textbox controls for the fields to be filled in and populated the labels with the appropriate values. I added code to hide or display some fields. I did it this way to allow for some mutually exclusive fields to be displayed depending on the data (e.g. separate fields for true or false).
>
> All this wonderfulness was a pain in the database to develop but once done, it exactly replicated the state forms.
>
> As Duane said, I, too, have never printed actual forms but with this procedure, it can be done.
>
> Jeff
>
> ----- Original Message -----
>
> From: "Duane Hookom" <duanehookom@...>
> To: "ms access professionals" <ms_access_professionals@yahoogroups.com>
> Sent: Tuesday, August 27, 2013 11:32:49 PM
> Subject: RE: [MS_AccessPros] Print A Form
>
>
>
>
>
> I never print forms. Consider creating a similar report and opening it with a where condition.
>
> Duane Hookom MVP
> MS Access
>
> > To: MS_Access_Professionals@yahoogroups.com
> > From: anandgb@...
> > Date: Wed, 28 Aug 2013 02:17:41 +0000
> > Subject: [MS_AccessPros] Print A Form
> >
> > I tried using the print function to print an open form. It prints the whole table that the form is attached to.
> >
> > How can I just print the current form (record) only.
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (4) |
Tidak ada komentar:
Posting Komentar