Form Setting Query Criteria

jlr573

New member
Local time
Today, 14:20
Joined
Aug 9, 2010
Messages
4
I'm trying to run a query based on the values on a text box in a form, i had this working then i changed something and now it doesn't work and i can't remember what i did to make it stop working.

Private Sub cmdJobCompleteButton_Click()
Me.Visible = False
DoCmd.OpenQuery "qryJobsCompletedJob", acViewNormal, acEdit
'DoCmd.Close acForm, "frmWorkOrders", acSaveYes
' DoCmd.Close acQuery, "qryJobsCompletedJob", acSaveNo
DoCmd.OpenReport "rptJobsCompletedJob", acViewReport, , , acDialog
End Sub

I have in the query criteria [Forms]![frmJobs]![txtJobNumber]
txtJobNumber is hold the value i want to use as the criteria, and yes i have check the spelling on everthing and it's correct.

when i click the button it runs the query and opens the report but the query doesn't bring in any records.

Please help.
 
I found the problem. But don't know how to fix it.
when i add two fields from a differnet table to the query it doesn't return a recod in the query.
 

Users who are viewing this thread

Back
Top Bottom