A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Populate a Field



 
 
Thread Tools Display Modes
  #1  
Old July 7th, 2009, 02:34 PM posted to microsoft.public.access
Eric Starn
external usenet poster
 
Posts: 45
Default 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  
Old July 7th, 2009, 03:00 PM posted to microsoft.public.access
Armen Stein
external usenet poster
 
Posts: 507
Default 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  
Old July 7th, 2009, 04:00 PM posted to microsoft.public.access
Eric Starn
external usenet poster
 
Posts: 45
Default 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  
Old July 7th, 2009, 06:53 PM posted to microsoft.public.access
Armen Stein
external usenet poster
 
Posts: 507
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.