Access VB question

D

danedder

I know this is a VERY BASIC question, but would appreciate help. I have a
form in Access2000 that is tied to a table and used for input. I want to
write a very simple SQL to retrieve and ID number from a table within the mdb
file and assign it to a variable. How would I do this? Essentially, the SQL I
want to write is: "select max(idea_number) from ideas;"
Thanks in advance for your help!!
 
C

Cindy M.

Hi =?Utf-8?B?ZGFuZWRkZXI=?=,
I know this is a VERY BASIC question, but would appreciate help. I have a
form in Access2000 that is tied to a table and used for input. I want to
write a very simple SQL to retrieve and ID number from a table within the mdb
file and assign it to a variable. How would I do this? Essentially, the SQL I
want to write is: "select max(idea_number) from ideas;"
The best place to get the attention of Access experts is an Access-specific
group, like
http://msdn.microsoft.com/newsgroups/default.aspx?dg=microsoft.public.access.mod
ulesdaovba&lang=en&cr=US

Your question, however, isn't very clear. You need to explain what the form +
table has to do with the SQL (the value you want to retrieve). To get you
started, take a look in the Access VBA Help under "QueryDef". This is the DAO
equivalent of writing a Query in the Access interface. Depending on whether you
choose to save it or not, it creates a query in the list of queries, or just
provides a temporary one for the moment.

(DAO is the Access Jet engine's "native" database programming language. Access
also supports ADO, but generally one uses DAO for Access, from within Access.)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top