If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Populate a Field
I am looking for some suggestions on how to populate a field. I created a
text field, [Asset ID], which will just be a random four digit number. This field will be used to identify the asset for its lifespan in the database. I also created a form so that all the asset info can be input by the user. I would like the [Asset ID] field to automatically populate in the form with a new number every time a user inputs a new asset. I have tried to use the auto-number option, however I am also using the [Asset ID] field in a one-to-many relationship with other tables and this seems to make everything go crazy. So I am looking for any help and ideas I can get. Eric |
#2
|
|||
|
|||
Populate a Field
On Tue, 7 Jul 2009 06:34:00 -0700, Eric Starn
wrote: I am looking for some suggestions on how to populate a field. I created a text field, [Asset ID], which will just be a random four digit number. This field will be used to identify the asset for its lifespan in the database. I also created a form so that all the asset info can be input by the user. I would like the [Asset ID] field to automatically populate in the form with a new number every time a user inputs a new asset. I have tried to use the auto-number option, however I am also using the [Asset ID] field in a one-to-many relationship with other tables and this seems to make everything go crazy. Hi Eric, I don't see any reason not to use an AutoNumber. It will be the primary key in your Asset table. The related tables with "many" records will also have AssetID as a field, defined as Numeric - Long Integer. You would need to be more specific about "everything going crazy". Be aware that with AutoNumber you'll have to choose sequential number or random. Random will have positive and negative numbers much larger than 4 digits. I don't recommend Random for your situation. Sequential will have gaps in the sequence sometimes, so you shouldn't care too much about what each actual value is. Armen Stein Microsoft Access MVP www.JStreetTech.com |
#3
|
|||
|
|||
Populate a Field
Thanks for the help.
Right now in my Asset table the [Asset ID] is a text field. So if I understand correctly keep it a text field in the Asset table but change the the [Asset ID] in the other table to a Numeric - Long Integer and it should work? Eric "Armen Stein" wrote: On Tue, 7 Jul 2009 06:34:00 -0700, Eric Starn wrote: I am looking for some suggestions on how to populate a field. I created a text field, [Asset ID], which will just be a random four digit number. This field will be used to identify the asset for its lifespan in the database. I also created a form so that all the asset info can be input by the user. I would like the [Asset ID] field to automatically populate in the form with a new number every time a user inputs a new asset. I have tried to use the auto-number option, however I am also using the [Asset ID] field in a one-to-many relationship with other tables and this seems to make everything go crazy. Hi Eric, I don't see any reason not to use an AutoNumber. It will be the primary key in your Asset table. The related tables with "many" records will also have AssetID as a field, defined as Numeric - Long Integer. You would need to be more specific about "everything going crazy". Be aware that with AutoNumber you'll have to choose sequential number or random. Random will have positive and negative numbers much larger than 4 digits. I don't recommend Random for your situation. Sequential will have gaps in the sequence sometimes, so you shouldn't care too much about what each actual value is. Armen Stein Microsoft Access MVP www.JStreetTech.com |
#4
|
|||
|
|||
Populate a Field
On Tue, 7 Jul 2009 08:00:16 -0700, Eric Starn
wrote: Thanks for the help. Right now in my Asset table the [Asset ID] is a text field. So if I understand correctly keep it a text field in the Asset table but change the the [Asset ID] in the other table to a Numeric - Long Integer and it should work? No, if you want to use automatic numbering it needs to be an AutoNumber in the Asset table and a Number - Long Integer in the related tables. Armen Stein Microsoft Access MVP www.JStreetTech.com |
Thread Tools | |
Display Modes | |
|
|