Report printing command button

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

I am working with a form that has a subform.

I select a value in a combo box and the subform points to only the data
associated with this value.

I want to place a combo box to print this associated information. I have
extensively search for the OpenReport reportname, , and have played with
the suggested 'filter' and 'where' statement to no avail. Some of the
literature on the microsoft site says you can point to a control on the form
to make a filter. Bullshit! or I don't understand it (probably). I'd love
to use an inline statement like (not right....but here goes)....companyname
(on the report) = control on the form.... Help! before I go totally grew!

Dave
 
Actually, I think the case is that you don't understand it
yet. Hang in there, you will. Here is some code that I use
to open a Customer's History report and sends the WHERE
statement saying limit it to the CustomerID on the current
form. "Me![CustomerID]" tells Access to use the value of the
CustomerID control on the current form (Me).


On Error GoTo Err_cmdHistory_Click

Dim stDocName As String

stDocName = "rptCustomerHistory"
DoCmd.OpenReport stDocName, acPreview, , "[CustomerID] =
'" & Me![CustomerID] & "'"

Exit_cmdHistory_Click:
Exit Sub

Err_cmdHistory_Click:
MsgBox Err.Description
Resume Exit_cmdHistory_Click

Gary Miller
Sisters, OR


Anonymous said:
I am working with a form that has a subform.

I select a value in a combo box and the subform points to only the data
associated with this value.

I want to place a combo box to print this associated information. I have
extensively search for the OpenReport reportname, , and have played with
the suggested 'filter' and 'where' statement to no avail. Some of the
literature on the microsoft site says you can point to a control on the form
to make a filter. Bullshit! or I don't understand it (probably). I'd love
to use an inline statement like (not right....but here goes)....companyname
(on the report) = control on the form.... Help! before I go totally grew!

Dave




----== Posted via Newsfeed.Com -
Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total
Privacy via Encryption =---
 
Thanks,

I'll give it a try.
Dave
Gary Miller said:
Actually, I think the case is that you don't understand it
yet. Hang in there, you will. Here is some code that I use
to open a Customer's History report and sends the WHERE
statement saying limit it to the CustomerID on the current
form. "Me![CustomerID]" tells Access to use the value of the
CustomerID control on the current form (Me).


On Error GoTo Err_cmdHistory_Click

Dim stDocName As String

stDocName = "rptCustomerHistory"
DoCmd.OpenReport stDocName, acPreview, , "[CustomerID] =
'" & Me![CustomerID] & "'"

Exit_cmdHistory_Click:
Exit Sub

Err_cmdHistory_Click:
MsgBox Err.Description
Resume Exit_cmdHistory_Click

Gary Miller
Sisters, OR


Anonymous said:
I am working with a form that has a subform.

I select a value in a combo box and the subform points to only the data
associated with this value.

I want to place a combo box to print this associated information. I have
extensively search for the OpenReport reportname, , and have played with
the suggested 'filter' and 'where' statement to no avail. Some of the
literature on the microsoft site says you can point to a control on the form
to make a filter. Bullshit! or I don't understand it (probably). I'd love
to use an inline statement like (not right....but here goes)....companyname
(on the report) = control on the form.... Help! before I go totally grew!

Dave




----== Posted via Newsfeed.Com -
Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total
Privacy via Encryption =---
 
Back
Top