Form Button with On Click Event OpenQuery

penwood

Registered User.
Local time
Yesterday, 22:18
Joined
Nov 26, 2005
Messages
51
I have trouble making a button work on my subform.

The query behind the scences is simple. it works if i manually enter the 3 answers. I use the following 3 criterias:

[forms]![frmPriceMain]![SoldtoID2]
[forms]![frmPriceMain]![ShipID2]
[forms]![frmPriceMain]![FormulaID]

Now the button on the subform has this On Click Event:

Private Sub Detail_Sales_Records_Click()
DoCmd.OpenQuery "2095Qry-SalesTransactionsFiltered", acNormal, acEdit
DoCmd.Maximize
End Sub

So when i am on a form record and hit the subform Button, i get no records.
but if i manually run the qry, i get my records. so the button is now working for me. Maybe some kind of SetFocus thing which i am unfamiliar with?

Penwood
 
Is these fields on MainForm or on Subform ??
Why is the command button on the sobform ???
 

Users who are viewing this thread

Back
Top Bottom