Filter

N

Nylex

I have a form “Orders†with a subform “OrderDetailsâ€

I enter the details and everything works fine – Gets the pricing from
Products file and the Clients name and Address from the Clients File

The entries are entered into a table “Orders†and “OrderDetails†and the
link field is “OrderIDâ€

My next step is to print out the Order

I have a report “Client Order†and it works fine and is laid out the way we
want it to but it prints out every record in the system when started

I start it with a Command Button on the Order form and a Macro runs - I only
want to print the Order I am currently looking at

Macro
Report Name Client Order
View Print Preview
Where Condition "[OrderID]=" & [Forms]![Orders]![OrderID]

How do I make the Filter work
 
W

Wayne-I-M

Put this OnClick of a button on your form

On Main Form>>>>>

To preview

Private Sub ButtonName_Click()
DoCmd.OpenReport "Client Order", acViewPreview, "",
"[OrderID]=[Forms]![Orders]![OrderID]", acNormal
End Sub

To Print

Private Sub ButtonName_Click()
DoCmd.OpenReport "Client Order", acViewNormal, "",
"[OrderID]=[Forms]![Orders]![OrderID]", acNormal
End Sub


Change the ButtonName

On a Subform>>>>>

Private Sub ButtonName_Click()
DoCmd.OpenReport "Client Order", acViewNormal, "",
"[OrderID]=[Forms]![MainFormName]![SubFormName].[Form]![OrderID]", acNormal
End Sub
 
N

Nylex

Worked Fine Tks

Wayne-I-M said:
Put this OnClick of a button on your form

On Main Form>>>>>

To preview

Private Sub ButtonName_Click()
DoCmd.OpenReport "Client Order", acViewPreview, "",
"[OrderID]=[Forms]![Orders]![OrderID]", acNormal
End Sub

To Print

Private Sub ButtonName_Click()
DoCmd.OpenReport "Client Order", acViewNormal, "",
"[OrderID]=[Forms]![Orders]![OrderID]", acNormal
End Sub


Change the ButtonName

On a Subform>>>>>

Private Sub ButtonName_Click()
DoCmd.OpenReport "Client Order", acViewNormal, "",
"[OrderID]=[Forms]![MainFormName]![SubFormName].[Form]![OrderID]", acNormal
End Sub


--
Wayne
Manchester, England.



Nylex said:
I have a form “Orders†with a subform “OrderDetailsâ€

I enter the details and everything works fine – Gets the pricing from
Products file and the Clients name and Address from the Clients File

The entries are entered into a table “Orders†and “OrderDetails†and the
link field is “OrderIDâ€

My next step is to print out the Order

I have a report “Client Order†and it works fine and is laid out the way we
want it to but it prints out every record in the system when started

I start it with a Command Button on the Order form and a Macro runs - I only
want to print the Order I am currently looking at

Macro
Report Name Client Order
View Print Preview
Where Condition "[OrderID]=" & [Forms]![Orders]![OrderID]

How do I make the Filter work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top