|
-
Mar 28th, 2006, 01:15 PM
#1
Thread Starter
Junior Member
[RESOLVED] Prompt everytime a INSERT SQL execution
I wrote a module to import data to Access from Excel using:
DoCmd.RunSQL (query)
The query contains a INSERT INTO... type SQL statement. Everytime Access runs this line it prompts me if it is ok to add a record to the database. Is there a way to remove this prompt?
Last edited by Hack; Mar 31st, 2006 at 07:28 AM.
-
Mar 28th, 2006, 01:18 PM
#2
Re: Prompt everytime a INSERT SQL execution
Turn warning off before you run the query, then turn them back on.
VB Code:
DoCmd.SetWarnings False
DoCmd.RunSQL (Query)
DoCmd.SetWarnings True
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Mar 28th, 2006, 01:39 PM
#3
Thread Starter
Junior Member
Re: Prompt everytime a INSERT SQL execution
Thanks DKenny!
I will give that a shot.
-
Mar 28th, 2006, 01:40 PM
#4
Thread Starter
Junior Member
Re: Prompt everytime a INSERT SQL execution
By any chance, do you know how to swap the labeling of rows and colums in Excel?
This means that If I want to access A3, I would type in 1C instead or if I wanted B4, I would type in 2D?
-
Mar 28th, 2006, 01:45 PM
#5
Re: Prompt everytime a INSERT SQL execution
First off, why would you want to do this?
Next, when you say "type in 1C" do you mean into a formula in an excel cell or a range reference in VBA?
Also, how do you plan on dealing with the fact that there are more rows than columns in a worksheet.
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
-
Mar 28th, 2006, 01:50 PM
#6
Thread Starter
Junior Member
Re: Prompt everytime a INSERT SQL execution
It is out of "kind a" curiousity. The reason is in VBA you seem to have to access a cell by numbers i.e. (2,3) => B3. In my case I know exactly how many I need in the vertical direction, but have to access specific columns. Thus seeing AM and converting to a number is a pain.
A somewhat cludgy solution to this is to insert a row and put in 1 and 2 for the two first horizontal cell and drag it out...
But it would be neat to be able to swap them sometimes. Sometimes you might have a lot more columns than rows and typing in a formula as "1C" would be convenient...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|