Capture value of a record in a table to use as a variable

G

Geoff Salmon

I want to create a series of tables from Excel spreadsheets. The names of
the spreadsheets are in an Access table called 'stcknames'

I can access the records in the table but I do not know how to capture them
and create a variable for use in the next command to create a new table, set
out below. There is something very simple that I am missing.

Thanks for any assistance you can offer. I am using Access 97

Sub NewTabls()

For n = 1 To 2
DoCmd.GoToRecord acDataTable, "stcknames", acGoTo, n

nwtble = ?? I WANT TO CAPTURE THE NAME OF THE RECORD HERE

DoCmd.TransferSpreadsheet acImport, 8, _
nwtble, "C:\GeoffsFolders\stockdata\stcknames.XLS", True, "a1:f765"

Next n

End Sub
 

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