Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Filter pass through to query

Status
Not open for further replies.

dolodolo

Technical User
May 27, 2003
86
US
Hi,

I am trying to pass the form filter (region) through to a query that is triggered by a button on the form. Right now the query prompts me for the filter value again. Here' the code that I have.

Private Sub UpdateInvButton_Click()
On Error GoTo Err_UpdateInvButton_Click

Dim stDocName As String

stDocName = "qryUpdateMainCost"
DoCmd.OpenQuery stDocName, acViewNormal, acEdit

Exit_UpdateInvButton_Click:
Exit Sub

Err_UpdateInvButton_Click:
MsgBox Err.Description
Resume Exit_UpdateInvButton_Click

End Sub

Any help would be much appreciated. Thanks,

Dolores
 
What is the SQL* for the query?






===============
* Choose SQL view from the query design window and cut-and-paste.
 
Here it is...

UPDATE tblMaintCost INNER JOIN (Inventory INNER JOIN Property ON Inventory.PropertyNbr = Property.Property) ON (tblMaintCost.EquipType = Inventory.EquipType) AND (tblMaintCost.Region = Property.Region) SET Inventory.Maintenance_Cost = [MonthlyCost], Inventory.[Trip Charge] = [TripCharge]
WHERE (((tblMaintCost.Region)=[Forms]![frmMaintCost]![Region]));
 
This bit:

SET Inventory.Maintenance_Cost = [MonthlyCost], Inventory.[Trip Charge] = [TripCharge]

Where is the data for MonthlyCost and Trip Charge?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top