Perform sql statement without using it as a recordset

V

Veus

Hi,

I have a booking system which has an individual and course assigned to
each booking.
Each course has a course class.
Each individual has a specification form which displays all the skills
a individual has.

When a booking comes in the class of the course is added to the
specification of the individual who booked.

The individual table has a few columns which are all checkboxes on the
access form. Next time i view the individuals specifications i want to
have the checkbox of the recently added classes (within the past few
months) to be readonly and possible have a different colour background.

This is to prevent people unticking a skill when they have recently
booked a course specialised in that skill.

Im used to web programming languages (e.g PHP) and this is very easy to
do in PHP.
I would just:
- create a select statement selecting all bookings made by the
individual within 3 months
- fetch the rows of that query into an array
- update the integer value in the related skill column to -1 (so its
checked)

Im fairly new with VBA and access and have had a look around but all
the sql examples are being used as a recordset.

Thanks for your time.
 
G

Guest

Create the SQL statement you want to perform the Action. Then use either the
Docmd.RunSQL method or the CurrentDb.Execute method to apply the changes.
The Execute method is superior to the RunSQL. It is much faster and you
don't have to worry about the annoying SetWarnings.

strSQL = "BLAH BLAH BLAH WHERE YACKITY YAK;"
CurrentDb.Execute(strSQL), dbFailOnError
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top