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

Procedure with a Data Type Mismatch error. 1

Status
Not open for further replies.

quest4

Technical User
Aug 27, 2001
735
US
Good morning folks. I have a table of users, tblAuthorizedUsers. In the table I have a text field, LogOn and a checkbox, ApdCCD. I have a main form, and on that form I have a command button, for approval, and in the procedure I am try to run a validity test to see if the checkbox, for the LogOn user, is false or not. When I click the command button I get the following message:
Data Type Mismatch in criteria expression.
Here is the code:
If DCount("[LogOn]", "tblAuthorizedUsers", "[ApdCCD]='False'") = 0 Then
Can anyone see what is wrong with this line? Thank you in advance for any assistance.
 
Hi Guest4,

you have your False setup as a string which is causing your error.

try:

If DCount("[LogOn]", "tblAuthorizedUsers", "[ApdCCD]= False") = 0 Then

take the single quotes out. that creates a string expression with checkboxes (yes/no) are not. they use true/false, yes/no, 0/-1.

HTH


Have A Great Day!!!, [bigglasses]

Nathan
Senior Test Lead
 
Thank you for the assistance, Nathan. You are good. It now works without erroring, but it is not yet stoping unaproved users from approving things. I will figure it out sooner or later. Thanks again for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top