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

Creating Tables - AutoNamed at run-time

Status
Not open for further replies.

journeyman

Programmer
Aug 29, 2002
5
0
0
GB
Hi,
Can anyone help?

I'm creating an on click event which will copy an existing table and rename it.. so far so good. However I'm trying to auto increase the number for the new table.

The script I was using to change the name was DoCmd.Rename but this seems to require a unique string in "" and will not take a variable.

I had hoped to grab the new table name from an autonumber in another table.

Any ideas?
 
Have you tried code something like:

intAutoNumber=DMax("Number","table")+1

strTableName="MyNewTable" & intAutonumber

Docmd.Rename strTableName

 
Hi dynamictiger
something like your suggestion has done the job - thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top