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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Query Parameters Based on Form Values

Status
Not open for further replies.

larrydavid

Programmer
Jul 22, 2010
174
US
Hello, I have a form which updates a work queue, updating one field in a table. However, the table is used in a query which is the record source for a subform in a tabbed control. On my update form I have two combo boxes, one with the original user and the other with the user it is going to be assigned to. The way I am passing the parameters is in the first Update Query fired by way of a cmd button click and Event Procedure. So, I have an input parameter like so:

forms.[frmreassign user].reasuser
...which is updating the Select query (table), which has a receiving parameter like so:

[forms].[frmreassign user].[orguser]

Actually, this works with another form where the query criteria is one WHERE clause (values on one line in the QBE grid) like so:

Field: Value1 Value2 Value3
Criteria: Is Null No [forms].[frm1].[orguser]

But on this other form that has a query like so, I cannot get the receiving parameter to work:

Field: Value1 Value2 Value3
Criteria: Is Null No [forms].[frm1].[orguser]
Is Null Yes [forms].[frm1].[orguser]

I tried entering the parameter once, twice but this doesn't work. I tried entering the parameter in the menu bar under Query-->Parameters, no good.

I hope this makes sense and that someone can please shed some light on this. I appreciate any help you can offer before I pull out my last hair.

Thanks,
Larry

 
I figured it out. It was actually a problem with having other calculated fields that were interfering with the update. I removed the unnecessary fields and the other criteria (from the display only) and it works faster and updates properly now. It seems that it is ok to have the forms query parm in both criteria (OR condition). Sorry, in the future I will do more testing before posting.
Thanks,
Larry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top