linking option buttons to query criteria ??

ccondran08

Registered User.
Local time
Tomorrow, 06:47
Joined
Feb 27, 2014
Messages
58
I have a query that has 2 fields of currency labour rates (current rate and baseline rate), but sometimes there are some blanks in either of the fields and is causing my text field which has a Sum formula (Rates x Hours) to #ERROR and throws out my other calcs. The only way to find out which blank line items are throwing my query numbers out is to manually type in “Is Null” in the criteria.
However, I would like to keep this process fully automated so I tried to create 2 lots of option buttons for my form, one for each of the 2 fields of currency labour rates and after I click on either option button and then run my query it will show all the lines that have blanks. I was able to link 2 text boxes to the option buttons (Select Case – Case 1 - Me.txtBox1.Value = "Is Null") and then link the text boxes to the criteria field using [Forms]![frm_labour]![txtBox1]. However, none of this seems to be driving my criteria in my query, just wondering if anyone has any ideas for me ??
 
The simpler approach would be to use an iif() statement in the query.
Iif(IsNull([RateField]),value to use if null,Rates x Hours).

Does the query use the value from a form in its calculations? Or does it use values record by record from a table?
You could avoid the heartache by making the rate fields required fields.
 

Users who are viewing this thread

Back
Top Bottom