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

Missing Criteria 1

Status
Not open for further replies.

ksimmsa

Programmer
Feb 6, 2004
22
US
I’m trying to update the coding for a report. I am having problems with the coding on the form. I have it broken down by certain criteria and they are all working, but one and I can seem to figure this one out. It looking up a number field and I am using the following syntax:

If Me!ChooseQuitCode = True Then
If stLinkCriteria <> "" Then stLinkCriteria = stLinkCriteria & " and "
stLinkCriteria = stLinkCriteria & "[dbo_customers.QuitCode] = " & "#" & ((Me!ChooseQuitCode)) & "#"
End If


Thanks in advance for you help.
 
Using the #'s signifies a DATE value.

You could try enclosing your value in '

e.g.
Code:
stLinkCriteria = stLinkCriteria & "[dbo_customers.QuitCode] = [red]'[/red]" &  ((Me!ChooseQuitCode)) & "[red]'[/red]"
Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks, HarleyQuinn, but now i;m getting a the following error: data type mismatch in criteria expression. Also how do i close out this thread?

thanks again.
 
Get rid of the single quotes if QuitCode is defined as numeric.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I changed it to:
If Me!ChooseQuitCode = True Then
If stLinkCriteria <> "" Then stLinkCriteria = stLinkCriteria & " and "
stLinkCriteria = stLinkCriteria & "[dbo_customers.QuitCode] =" & ((Me!ChooseQuitCode))
End If

and it is not recognizing it.

thanks.....I do i close out the thread?
 
If Me!ChooseQuitCode = True
Is dbo_customers.QuitCode a Boolean field ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
So, you have some logical inconsistency in your criteria.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, i got it

If Me!ChooseResultCode = True Then
If stLinkCriteria <> "" Then stLinkCriteria = stLinkCriteria & " and "
stLinkCriteria = stLinkCriteria & "[dbo_customers.QuitCode] = " & ((Str(Trim(Me![SpecificResultCode]))))
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top