467,894 Members | 1,436 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,894 developers. It's quick & easy.

Linking form - Report

I have a form called frm_quote and a report called rpt_quote.
I want to be able to view the form on a particular quote number (field:
QuoteNo - autonumber) and then go to the report where the the info on that
particular quote no. is shown in the report.

frm_quote is linked to query: qry_viewquote
rpt_quote is linked to: qry_viewquoterpt

In design of qry_viewquoterpt - I simply have the expression (for the
field: QuoteNo ) [Enter Quote No]. This method does the job however I
would like it to automatically recognize the quote number as described
earlier without this manual input of the user.
thanks.

Nov 13 '05 #1
  • viewed: 2233
Share:
2 Replies
It's a common solution to put a command button on your form that will open
your report. Set the criteria to limit your report to a value on the form.
An example:

Private Sub PrintForm_Click()
On Error GoTo Err_PrintForm_Click

Dim DocName As String
Dim LinkCriteria As String

DoCmd.DoMenuItem A_FORMBAR, A_FILE, A_SAVERECORD

DocName = "MemRecord"
LinkCriteria = "[V-ID] = Forms![MemEntry]![V-ID]"
DoCmd.OpenReport DocName, A_PREVIEW, , LinkCriteria

Exit_PrintForm_Click:
Exit Sub

Err_PrintForm_Click:
MsgBox Error$
Resume Exit_PrintForm_Click

End Sub

The command button wizard will do most all of this for you.
-Ed

"Gt394" <g4****@hotmail.com> wrote in message
news:43***********************@news.optusnet.com.a u...
I have a form called frm_quote and a report called rpt_quote.
I want to be able to view the form on a particular quote number (field:
QuoteNo - autonumber) and then go to the report where the the info on that
particular quote no. is shown in the report.

frm_quote is linked to query: qry_viewquote
rpt_quote is linked to: qry_viewquoterpt

In design of qry_viewquoterpt - I simply have the expression (for the
field: QuoteNo ) [Enter Quote No]. This method does the job however I
would like it to automatically recognize the quote number as described
earlier without this manual input of the user.
thanks.

Nov 13 '05 #2
On Wed, 28 Sep 2005 07:43:34 +1000, "Gt394" <g4****@hotmail.com>
wrote:

Take out the [Enter Quote No].
Then when opening the report using DoCmd.OpenReport, take a look at
the WhereClause argument. Set it to something like:
"QuoteNo=" & Me.QuoteNo

-Tom.

I have a form called frm_quote and a report called rpt_quote.
I want to be able to view the form on a particular quote number (field:
QuoteNo - autonumber) and then go to the report where the the info on that
particular quote no. is shown in the report.

frm_quote is linked to query: qry_viewquote
rpt_quote is linked to: qry_viewquoterpt

In design of qry_viewquoterpt - I simply have the expression (for the
field: QuoteNo ) [Enter Quote No]. This method does the job however I
would like it to automatically recognize the quote number as described
earlier without this manual input of the user.
thanks.


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Colin Graham | last post: by
4 posts views Thread by Mark T. | last post: by
2 posts views Thread by TheTamdino | last post: by
3 posts views Thread by Parasyke | last post: by
1 post views Thread by Parasyke | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.