Assign Primary Key Value to Variable

RaunLGoode

Registered User.
Local time
Today, 09:15
Joined
Feb 18, 2004
Messages
122
I am importing Data from an Excel spreadsheet into Access
As each record is processed, It is assigned a Primary Key value, which becomes the document # for each record this field is called DocNum.

I would like to copy the Access number back into the Excel document. I think the best way to do this will be to save the Primary Key Value as a variable. Then I can return to Excel, Assign the value of the variable to the proper cell on the spread sheet, and loop to the next record.
I have been unable to write a command to assing the Primary Key Value to the variable.
I declare the Variable
[ Dim dblRecNum AS Double] (lots of records)
and then I have tried assign the Current DocNum Value to dblRecNum using various versions of the command:
[dblRecNum = DocNum.Value]

None of these have worked. Could somebody tell me what the proper syntax is to assign the value of a new record (or any record) to a variable?
 
dblRecNum = DocNum

But it depends on just what DocNum represents!

can you post the code that you are using to import the records?

Peter
 
Reply

Peter,
Haven't had a lot of time to work on this today. Initial attempts were unsuccessful. I am tryiny to de-bug. I will try to work on this over the weekend.
Raun
 

Users who are viewing this thread

Back
Top Bottom