VBA Code Examples

Coldsteel

Registered User.
Local time
Today, 16:23
Joined
Feb 23, 2009
Messages
73
Hello all

Does anyone know where to find some good VBA or V-script tutorials or books. Also where to find easy to understand definitions of code.
 
Thanks for the website it is awsome!! I have a question, I am trying to make a combo box display tables from my current database. Do you know what vb funt would be the best to research?

Thanks,
Mike
 
Hi -

Copy/paste this to a new query (in SQL view). This will return all non-system tables in your current database.

Code:
SELECT MSysObjects.Name
FROM MSysObjects
WHERE (((MSysObjects.Type)=1 Or (MSysObjects.Type)=6) AND ((Left([Name],4))<>'MSys'))
ORDER BY MSysObjects.Name;

Use it as the row source for your combo box.

HTH - Bob
 
Thanks for the code it works like a charm. I have a few questions is SQL easier to manage than access and do you have a suggestions as to where to learn the code?
 
The code provided is precisely what you'd see if using the query wizard -- with the exception that MSysObjects is a hidden systems table which you wouldn't see when selecting a table, thus having to provide the SQL.

Examining the SQL created using the query wizard is always helpful in understanding SQL. Keep in mind that SQL and VBA are two different animals. The site provided by Bob Larson should be very helpful in learning / understanding VBA.

Best Wishes -- Bob
 
Thanks for the code it works like a charm. I have a few questions is SQL easier to manage than access and do you have a suggestions as to where to learn the code?
There are several good SQL tutorials on the web. Google and see what you find
 

Users who are viewing this thread

Back
Top Bottom