Load form, print it, close it.

  • Thread starter Thread starter Ynot
  • Start date Start date
Y

Ynot

Is there a way; from form "A" to load form "B", print it and close it ?



Thanks for the help.
 
Generally speaking, you would print a report, not a form.
Without some details it is difficult to provide much
guidance, but the short answer is that a command button on
a form can print either a form or a report. Just use the
command button wizard. See Help if you need details on
how to do that. A command button set up by the wizard to
print a report does so without ever showing the report. I
assume it works the same way for printing a form.
 
I wanted to print the form since there are over 300 fields on it and the
person that put it together made it look like the old paper form that they
used. The forms has to be printed taken to a job site some blanks filled in
or items changed then updates made to the database. Since people are very
familiar with the paper form it is easy for them to use a printed copy in
the filed or the Access for updating information.



When updates are done and I need to print a copy to go out to the field I
can use WhereCond to load a form with the correct record but I can't figure
out how to force form "B" to print while Form "A" is active. I know how to
close form "B" from form "A"
 
Sounds like you have a lot of work ahead of you. The proper way to do this
is to build and print a report. Not a form.

You should be able to make the report look just like your old paper form
too.

Rick B



I wanted to print the form since there are over 300 fields on it and the
person that put it together made it look like the old paper form that they
used. The forms has to be printed taken to a job site some blanks filled in
or items changed then updates made to the database. Since people are very
familiar with the paper form it is easy for them to use a printed copy in
the filed or the Access for updating information.



When updates are done and I need to print a copy to go out to the field I
can use WhereCond to load a form with the correct record but I can't figure
out how to force form "B" to print while Form "A" is active. I know how to
close form "B" from form "A"
 
Ynot said:
I wanted to print the form since there are over 300 fields on it and the
person that put it together made it look like the old paper form that they
used. [snip]

Right-click on the form and choose "Save as Report".

Now you have a report that looks just like the form and you can easily
print it with a filter applied from a command button.
 
Is there a way; from form "A" to load form "B", print it and close it ?

Thanks for the help.

You should create a report.
You could then use the OpenReport method to run the report from the
form.

In any event, to print Object B while another Object, A, is open, you
can use the SelectObject and the PrintOut methods to do so.
See Access help for the correct arguments for both.
 
I found an answer. Thanks for looking. I posted the code following if
anyone is interested.

Private Sub PrintForm_Click()

On Error GoTo Err_PrintForm_Click



Dim MyForm As Form

Dim stDocName As String

Dim stLinkCriteria As String

stDocName = "JobCardPrint"



stLinkCriteria = "[JOBNUMBER]=" & Me![JOB NUMBER:]

DoCmd.OpenForm stDocName, , , stLinkCriteria



Set MyForm = Screen.ActiveForm

DoCmd.SelectObject acForm, stDocName, True

DoCmd.PrintOut

DoCmd.SelectObject acForm, MyForm.Name, False



DoCmd.Close acForm, "JobCardPrint"



Exit_PrintForm_Click:

Exit Sub



Err_PrintForm_Click:

MsgBox Err.Description

Resume Exit_PrintForm_Click



End Sub
 
As Rick Brandt has pointed out, you can easily save the
form as a report. You can fill out the form on screen,
then print the report from a command button on the form.
There are a lot of advantages to printing reports rather
than forms, including grouping and sorting options that
are not really available in the same way with forms, at
least not as conveniently. Other advantages will make
themselves apparent as you go.
 
Back
Top