Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / July 2006

Tip: Looking for answers? Try searching our database.

Query Criteria help.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
mjj4golf - 10 Jul 2006 04:19 GMT
I am using a true or false criteria in a query like this in the criteria field:

Whats_Status("Varname")

The function is defined like this:
Public Function Whats_Status(Varname As Boolean) As Boolean
   Whats_Status = varname
End Function

Varname is publ.ic

But I am getting an " unknown jet error"
What am I doing wrong?

Mike
John Vinson - 10 Jul 2006 05:33 GMT
>I am using a true or false criteria in a query like this in the criteria field:
>
[quoted text clipped - 11 lines]
>
>Mike

You're passing a text string "Varname" into a parameter which is
defined as Boolean, for one thing. Try Whats_Status(Varname As
String). You will probably also need to use

Whats_Status = Eval(Varname)

to evaluate the value of the variable defined by varname.

                 John W. Vinson[MVP]    
mjj4golf - 10 Jul 2006 12:30 GMT
but the field in the query is a true/false.  So that is why I made it boolean.

Mike

> >I am using a true or false criteria in a query like this in the criteria field:
> >
[quoted text clipped - 21 lines]
>
>                   John W. Vinson[MVP]    
John Vinson - 10 Jul 2006 18:08 GMT
>but the field in the query is a true/false.  So that is why I made it boolean.
>
[quoted text clipped - 3 lines]
>> >
>> >Whats_Status("Varname")

You're passing the function a parameter "Varname". That is a literal
text string. It is not a boolean, and the definition of the function
is expecting you to pass a Boolean value (True or False, or
equivalently -1 or 0), NOT a text string.

Could you explain the logic here? Exactly what are you trying to
accomplish? Where does the value of varname get set? Why are you using
varname as both a string constant, and as a variable (I'm guessing
this is an example for the purpose of this newsgroup post, not
actually how you would use the function)?

                 John W. Vinson[MVP]    
mjj4golf - 10 Jul 2006 23:46 GMT
Sorry for the confusion, but that's because I am.
I have a query on a table w/ a boolean.  I want to put a variable(boolean)
in a module in a form w/ an option box.  Depending on which one is chosen,
the variable is a true or false.  I then would do the query using the
criteria in the field.
Mike

> >but the field in the query is a true/false.  So that is why I made it boolean.
> >
[quoted text clipped - 16 lines]
>
>                   John W. Vinson[MVP]    
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.