QBF Help

JPRENG

Registered User.
Local time
Today, 04:11
Joined
Jun 26, 2013
Messages
37
I have a QBF running for 3 text boxes but I can't fiure out the code so the QBF will use a check box as the criteria also? How do I do this. I tried:

Forms![QBF_Form]![WhatInduction] = True

but this didn't work.
 
It is possible only as criteria for an Yes/No field.
And the syntax (in the criteria row) is:
Forms!FormName!CheckBoxName
Access will do the rest (will add brackets).
Of course, when you run this query, the form must be in runt time.
 
I have tried that but it didn't work. My 3 text boxes are;

Employee ID
First Name
Last Name

I want to add a check for 'Induction' so I can tick it and the QBF will return all employees who have the Induction field ticked in the Employee table.
 
Assuming the query you are using has a field call "Induction" and it is a YES/NO field, then a simple form reference as Mihail suggested (Forms!FormName!CheckBoxName) will work. If it is not, then the control on the form may not be returning a Yes (-1) or a No (0). To test that, put the form reference in the query as a Field. run the query a see what the form reference is returning as a value.

What happens when you run the query with the form reference in the criteria? Is there an error message?
 
I have created a check box on my QBF Form. Called Induction. And in my Query I have added ;

[Forms]![QBF_Form]![Induction]

When I run this it returns all records where the induction check box is ticked and also unticked
 
Upload your database (convert in 2003 version)
 
Here you go. If from the home form you go >Employee Database>Search for an Employee.
 

Attachments

I have checked and your formula is very good.
Why seems that don't work ? I repeat: seems.
Because you have a lot of OR relations in the query. So, if only one of the terms of the OR relation is TRUE then the result will be TRUE.
Hope you understand this.

But this is far away to be a big problem.
The main problem is that you have... 125 fields in the table tblEmployeeInfo ?!?!?!?!?!?!?
The same observation about the other 2 tables. Not 125 fields but... a lot. More more more beyond the necessary.

Believe me: You will never finish this database. Not this way.
Sorry for this bad news.
 
How would you suggest I go about it then? Maybe a drop down box, with multiple selections allowed, to select the employees qualifications from?
 
No. By starting from scratch AFTER you read something about the concept of NORMALIZATION for databases.
 

Users who are viewing this thread

Back
Top Bottom