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

How to run a query based on boolean values - "flag"?

Status
Not open for further replies.

intrepidtechie

Programmer
Nov 6, 2004
27
0
0
US
The Scenario: A VB process runs and updates the MS Access DB with new data everyday. I have created a query to make some changes to the data once its imported. Currently I have to run it manually. Would like to automate the process.

Some one suggested this method given below
Store a value in a Ms Access table such as a TRUE or a 1 or whatever the VB runs.
Then look to see if that value is there when you open the db in Access.
Would most likely use a Boolean field and set it's condition TRUE or FALSE.
Set it TRUE when the VB runs and reset it back to FALSE when you open Access and run your query.

Can anyone provide an example of this can be done
 
Not sure what you are trying to accomplish. However, feel I need to make a comment which you may or may not know.
In VB a True has numeric value of 1. False has a numeric value of 0. In MSAccess True has a numeric value of -1 and False has a numeric value of 0.
Anyway...Trying to avoid a "gotcha
 
intrepidtechie
Looks pretty straightforward - where have you got to with your code so far?

Creepers

To avoid confusion just type in:

?cint(true)

in the Immediate window. It will return -1

However any non-zero Int will return True if converted to Boolean:

?cbool(2)

will return True

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'

for steam enthusiasts
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top