Need help assigning reference numbers to records where same customer appears

karatekid

Registered User.
Local time
Today, 20:43
Joined
Sep 11, 2011
Messages
10
Hi guys! I've looked everywhere in the last few days, but I couldn't find much that I could use :banghead:. I'm fairly new to Access VBA, and I don't know if this is even possible...

I'm trying to put together a DB for creating notifications to customers. The source file is pulled out from another system as an Excel file, which is then uploaded to Access via VBA. The user runs a query, and then sends the results (customer information) to an Excel file where we have set up a mail merge document (the notification itself).

A customer may appear in multiple records (having multiple accounts), but will only receive one notification.

What we're trying to do is give each notification an unique ID that will become its document reference number once the document is created. The number will need to be the same for all the records in which the customer appears, and they will need to be consecutive, as the documents themselves will be stored in PDF form later on in the process.

So I would like to assign an unique ID to each customer, each time it shows up when querying the uploaded source file (the query is done in a form, that has a sub-form for showing the results). Then, when exporting the query results, they will be also copied and stored to another table, along with the assigned reference number, for monitoring purposes.

The Access file itself will be split and used by multiple users (up to 9 users at a time). In theory, each user will see their own customers (each customer account is assigned to a certain user), but the number assignation will need to also depend on when the query has been run. For example, if user 1 queries the DB at 9:30AM they will get records numbered 1000 to 1050; user 2 (who queries the DB at 9:31AM) gets numbers 1051 to 2100 etc.

Does anyone have any idea as to how this could be done? Any help would be much appreciated.
 
I know that I am the owner of a poorly English. But there are rarely the cases when I understand... nothing. And this is one of them.

You lost me somewhere between Excel and Access.
I understand that you have some data in Excel, you "upload" this data in Access (as far as I know, Excel can run queries too) then manipulate somehow, then "downloaded" back to Excel in order to be mailed to some peoples (Access can mail too) .

Nothing about your data, relationships etc.

Hope others to understand your problem and, if they have a bit of time, to "translate" for me too.
 
I'm trying to put together a DB for creating notifications to customers. The source file is pulled out from another system as an Excel file, which is then uploaded to Access via VBA. The user runs a query, and then sends the results (customer information) to an Excel file where we have set up a mail merge document (the notification itself).
Excell would seem to be irrelevant. You should pull the information directly from the source into Access. Usually, that can be accomplished through and ODBC connection. You can run mail merge from Access.

So I would like to assign an unique ID to each customer, each time it shows up when querying the uploaded source file (the query is done in a form, that has a sub-form for showing the results). Then, when exporting the query results, they will be also copied and stored to another table, along with the assigned reference number, for monitoring purposes.
As Mihail pointed out, this is confusing. Your desire for a unique ID may actually involve two types of unique IDs. One, the Primary Key (PK) and the other an "account number" for the customer.
 

Users who are viewing this thread

Back
Top Bottom