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

Using Insert Into an AutoNumber Field from a Macro

Status
Not open for further replies.

hcisteve

Technical User
Jan 12, 2005
47
US
I wanted to create a macro that does an Insert into of an autonumber field from a Macro. I started off by choosing RUNSQL. I can't seem to get anywhere.

My latest attempt for the statement is

Insert into tblTrackerTest (index) SELECT [tblTracker].index from tblTracker

I thought that I could just select another index and use that. I am open to doing this a differnt way. The macro keeps telling me that it does not recognize the first use of index.
 
Index isn't a good name for a field since index is an index and is generally made up of one or more fields. If you don't want to change your field name, try wrap it like: [Index].

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Index is a dangerous word to use as you can't manipulate them with SQL. However I doubt it is an illegal name although it is an SQL word (as in CREATE INDEX), so could be. What's more of a problem, I think, is you are trying to turn an autonumber into a manualnumber. I worry that will get you into trouble later.

What goes wrong with your query?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top