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

How to add VBA code to my query? (noob) 1

Status
Not open for further replies.

knifey

Technical User
Nov 14, 2006
180
GB
Hi,
I'm a complete noobie at Access but do have some experience coding Excel VBA. My problem is I can't find how to attach my VBA code to my query!
I have some validation code which I would like to add to a make table query. So the query will run, then my code will fire to validate and correct the data in the newly created table (all database queries use this table as the root).
I know this is usually done in the user data entry form, but this database dosn't have forms. Data is imported directly from Excel using VBA.
Any advice will be much appreciated.
Thanks,
Knifey
 
Data is imported directly from Excel using VBA
So, put the validation code in the import code.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Your Queries will be running within jetSQL, I imagine. VBA code is what's used to automate making things happen...

So, you should be able to run your queries, imports, etc, all within VBA.

If your queries are already objects within your Access Database, you can also pare them down to SQL strings, and just run them from your VBA code.

Did you ever get sorted out what you wanted accomplished?

--

"If to err is human, then I must be some kind of human!" -Me
 
Thanks PHV,
I just added the validation code to the data import process and it worked like a charm.
Cheers,
Roy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top