automatic update of field.

  • Thread starter Thread starter lynn atkinson
  • Start date Start date
L

lynn atkinson

on running a query, I want it to automatically tick
the 'confirmed' box. For example the query finds all the
unconfirmed bookings for a particular location. After
running the query and producing the report, I want it then
to automatically update the 'confirmed' checkbox to
indicate that the booking has been confirmed. Is this
possible without being very complicated?

thanks
 
Use an Update query to set the yes/no field to True for the records in the
report.

For example, use this code:
strSql = "UPDATE [MyTable] SET [confirmed] = True WHERE ...
dbEngine(0)(0).Execute strSQL, dbFailOnError

The WHERE clause needs to match whatever records are in your report.
 
Lynn,

What you need is an Update query to "check the boxes", which will have the
exact same criteria as the one "feeding" the report, and will run after the
report is run.
I do something similar in an app, I have a form on which the user enters the
parameters for the report and clicks on a button. The code behind the button
prints the report (which takes its records from a query that uses the
parameters on the form for its criteria), and then it runs the Update query
that sets my yes/no field to true for the selected records. The same thing
can be done with a macro very easily, if you don't feel comfortable with
code.

HTH,
Nikos
 
Back
Top