C
Clay
I've got a report that runs billing info on all customers (using a query, not
a table). I want a button on my customer form that will open the report in
preview mode, but with only that customer's info.
I did something similar years ago with an openform, but I'm not sure how I
came up with the code.
_________________________________________________________________
Private Sub CommandEngineDetail_Click()
On Error GoTo Err_CommandEngineDetail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEngine"
stLinkCriteria = "[EngineID]=" & Me![EngineID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_CommandEngineDetail_Click:
Exit Sub
Err_CommandEngineDetail_Click:
MsgBox Err.Description
Resume Exit_CommandEngineDetail_Click
End Sub
_____________________________________________________________
This button pulls up my engine form with a particular id (from a form that
has a list of all engines on it), or can be run standalone to just display
all engines down the index path. Which is what I want my billing report to
do. I want the CustomerID on my form and my CustomerID on the query to
match, and pull up only that customer.
I'm looking around on how to use OpenForm, but I'm not getting the gist.
Any help would be appreciated.
Clayton
a table). I want a button on my customer form that will open the report in
preview mode, but with only that customer's info.
I did something similar years ago with an openform, but I'm not sure how I
came up with the code.
_________________________________________________________________
Private Sub CommandEngineDetail_Click()
On Error GoTo Err_CommandEngineDetail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEngine"
stLinkCriteria = "[EngineID]=" & Me![EngineID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_CommandEngineDetail_Click:
Exit Sub
Err_CommandEngineDetail_Click:
MsgBox Err.Description
Resume Exit_CommandEngineDetail_Click
End Sub
_____________________________________________________________
This button pulls up my engine form with a particular id (from a form that
has a list of all engines on it), or can be run standalone to just display
all engines down the index path. Which is what I want my billing report to
do. I want the CustomerID on my form and my CustomerID on the query to
match, and pull up only that customer.
I'm looking around on how to use OpenForm, but I'm not getting the gist.
Any help would be appreciated.
Clayton