By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 884 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Inserting a value from an Access form into a SQL pass through query

P: 94
I am creating a small Access db which performs a series of updates to a SQL db.

The Access db consists of a ‘Main Form’, from which the user can run each update via a series of command buttons.

Each update has been written as a SQL pass-through query.

Example Update:

UPDATE unit_instance_occurrences uio
SET fes_active_places =
(SELECT COUNT(*) FROM registration_units ru
WHERE ru.fes_unit_instance_code = uio.fes_uins_instance_code
AND ru.uio_occurrence_code = uio.calocc_occurrence_code
AND ru.progress_status = 'A'
AND ru.uio_occurrence_code = 07);

Each query is dependant on a year (07) however I want the user to determine the year from a combo box on the ‘Main Form’.

How do I best go about this? If necessary I can rewrite the pass-through update queries as pure Access-update queries.

Have not been having much success as my VB knowledge is limited. Any help would be much appreciated. Many thanks.
Sep 12 '07 #1
Share this Question
Share on Google+
2 Replies


debasisdas
Expert 5K+
P: 8,127
Are you trying to update both the databases in parallel ?
Sep 12 '07 #2

P: 94
Are you trying to update both the databases in parallel ?
The objective is to update a table in the SQL database.

The key thing is that i want to be able to run my pass through query from a button on a form. Before clicking the button the user must select the year. I want to be able to insert that year into the body of the PTQ.

It is just so i can set everything up and the user can then define the year when running the query.
Sep 12 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.