I need to tie multiple records to one autonumber. For example, I am entering vendor savings into access. I need access to autonumber my first record for each vendor. Each vendor has multiple ship points and each one will be a new record. Is there a way to tie each record to the autonumber assigned to the first record for that vendor?
Is there a way to tie multiple records to one autonumber?
Collapse
X
-
J DillardTags: None -
How is each vendor identified? Do they have a unique vendor ID that you can use to tie them together? The purpose of autonumber is usually to have a unique identifier for each record, and as such, it wouldn't be advisable to have several records all with the same autonumber.
If however, by autonumber you mean a unique number attached to each new vendor and replicated for every subsequent record for that vendor, then yes, this is possible.
Let's say you have a non-unique random number field that is used for the vendor autonumber when you first create a record. Access would assign a number to this field for every new record, and you could simply change it based on one of many possible criteria. For example:
1) On the form close event you use DLOOKUP to find the vendor's number in a table and overwrite the current autonumber with that value.
2) You have a combo select box listing all vendors and when you select the vendor it assigns that vendor number to the current autonumber field.
3) If you already have multiple records with the same vendor, you could run an update query based on a criteria you select or code.
I hope this offers you some direction. If not, please give me a better idea of your database layout and I'll try to be more specific. -
Why not just set up a one to many relationship with a subform displaying the many. The one side can simply be the autonumber associatated with a vendor where the many could be an entry for each of the areas that the vendor can ship to along with the information which they have shipped.Comment
Comment