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!

working with tables programmatically..

Status
Not open for further replies.

thatguy

Programmer
Aug 1, 2001
283
US
Hey there folks--

I'm trying to make a switch to Access (2002) from FoxPro and am having a LOT of trouble figuring out how to work with tables directly through VBA. Specfically, when a new record is created, I need to search through the table, find the largest value in a particular field, increment it and set the new record's field to that value (not an AutoNumber) -- example: the largest value would be Q030401A.. the next value would be Q030401B).

Can someone give me a brief (or detailed) run-down of how to work with tables directly thru VBA? I've searched for tutorials, but most talk about a var type of Database, which is undefined in Access 2002... I'm confused. Help?

Thanks
-- michael~
 
I think you will have to set a reference to DAO first if you want to see the Database object. If you are in the debug window, there will be a menu item Tools - References...

However, in Access 2002 you will probably have a reference to ADO. ADO does not have a database object, but works with connections and commands (queries).

There is some data on the difference between DAO and ADO on tek-tips.

Best regards
 
do a search in these fora for the term (keyword?) "basIncrAlphN". A routine is posted.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top