How to Print a Blank Form (1 Viewer)

JCorreia

Registered User.
Local time
Today, 09:13
Joined
May 9, 2013
Messages
17
Hi, in Access 2007 I'm trying to print out a blank form so users can fill in rough notes while on the phone with a client, etc. I currently have a print macro button on the form, but the entire page shows up blank (titles, everything) when I try to print a an empty form.
A possible solution I've thought of is to check if the form is blank and then open and print a separate report that's just a copy of the form and printing that, but it doesn't seem like a very elegant solution.
Does anybody have any other ideas/methods they've used?
Thanks in advance.
 

PaulO

Registered User.
Local time
Today, 13:13
Joined
Oct 9, 2008
Messages
421
You could perhaps store a 'dummy' record (with mostly blank fields) in the data Table and get your Query and Macro to print out this 'dummy'?
 

JCorreia

Registered User.
Local time
Today, 09:13
Joined
May 9, 2013
Messages
17
But I'd need to have some sort of text in some of the controls, since Access deletes any trailing spaces, right?
 

billmeye

Access Aficionado
Local time
Today, 09:13
Joined
Feb 20, 2010
Messages
542
Creating the blank record is your solution. You only need to have 1 field filled in (should be your primary key which wouldn't get printed anyway) and the report will now show for that record as all blanks.
 

JCorreia

Registered User.
Local time
Today, 09:13
Joined
May 9, 2013
Messages
17
Unfortunately my primary key is the file number (because I didn't want anybody making files without a file number), and the file number is displayed on the form.
 

GreenshootProgrammer

Registered User.
Local time
Today, 13:13
Joined
Jan 16, 2013
Messages
74
Create a report that doesn't use row sources then link to that report with a button labeled print blank form.
 

JCorreia

Registered User.
Local time
Today, 09:13
Joined
May 9, 2013
Messages
17
Ok, so no way to do it with the same print button that I already have on the form?
 

billmeye

Access Aficionado
Local time
Today, 09:13
Joined
Feb 20, 2010
Messages
542
In the report On Open event you can test for your dummy file number and choose to not show the value by changing the controls source to null:

Code:
If Me.fileNumber = 0 Then Me.FileNumber.ControlSource = ""

This will leave the file number blank. I would consider using 0 or a negative number as this dummy records file number, something that would never actually occur.
 

Falcone203

Member
Local time
Today, 08:13
Joined
Dec 5, 2019
Messages
40
Ok, so no way to do it with the same print button that I already have on the form?
FFAN is an auto number, 168 is a blank record.


Private Sub cmdPrtApplication_Click()

Dim FF As Integer

MsgBox Nz(Forms!frmffaddinfo!FFAN, "168")

FF = Nz(Forms!frmffaddinfo!FFAN, 168)
DoCmd.OpenReport "rptNMPKG", acViewPreview, , "[FFAN]=" & FF ' or have it go to a new record with an "IF" clause

End Sub


Now if you want a number generated, have the code generate a "Date Created". Since you now have an entry it will generate your ID. I use MsgBox to track my code.


DoCmd.GoToRecord acActiveDataObject, "frmffaddinfo", acNewRec
Me![Date Created] = Now()
Call cmdPrtApplication_Click


My report has multiple subreports that are selected to be printed


If IsNull(Forms!frmffaddinfo!NM1) = True Then
Me!rptNM1ASP_122.Visible = False
Else
Me!rptNM1ASP_122.Visible = True
End If

1619384144014.png
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:13
Joined
Feb 19, 2002
Messages
42,970
1. Storing a "blank" record is poor because it prevents you from defining RI and it also prevents you from enforcing validation rules. Saved data should always be validated.
2. Forms are not optimized for printing so make a report. You can have two buttons. One to print the report with the current record and another to print the report empty.
 

Users who are viewing this thread

Top Bottom