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  

fake Autonumber



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2010, 03:08 PM posted to microsoft.public.access
Emma
external usenet poster
 
Posts: 493
Default fake Autonumber

Hi I already have an autonumber in my table and would like to have a second
one just for certain items. Can I use the following somewhere in the table's
definition:
dmax("FieldName", "TableName") + 1

  #2  
Old May 18th, 2010, 03:22 PM posted to microsoft.public.access
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default fake Autonumber

On Tue, 18 May 2010 07:08:03 -0700, Emma
wrote:

Try setting that as the Default Value for the field.

-Tom.
Microsoft Access MVP


Hi I already have an autonumber in my table and would like to have a second
one just for certain items. Can I use the following somewhere in the table's
definition:
dmax("FieldName", "TableName") + 1

  #3  
Old May 18th, 2010, 04:53 PM posted to microsoft.public.access
Emma
external usenet poster
 
Posts: 493
Default fake Autonumber

Unfortunately it doesn't like dmax

"Tom van Stiphout" wrote:

On Tue, 18 May 2010 07:08:03 -0700, Emma
wrote:

Try setting that as the Default Value for the field.

-Tom.
Microsoft Access MVP


Hi I already have an autonumber in my table and would like to have a second
one just for certain items. Can I use the following somewhere in the table's
definition:
dmax("FieldName", "TableName") + 1

.

  #4  
Old May 18th, 2010, 05:17 PM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default fake Autonumber

On Tue, 18 May 2010 07:08:03 -0700, Emma
wrote:

Hi I already have an autonumber in my table and would like to have a second
one just for certain items. Can I use the following somewhere in the table's
definition:
dmax("FieldName", "TableName") + 1


No. A Table cannot contain expressions, and its default value cannot reference
any other field in the table. You'll need to do this on a Form.
--

John W. Vinson [MVP]
  #5  
Old May 18th, 2010, 07:45 PM posted to microsoft.public.access
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default fake Autonumber

Your question hints at your tables are not designed correctly. Take a look
at the design of your tables and mayne you will find you don't need a fake
autonumber. If you like, posy your tables here and we will advise you.

Steve



"Emma" wrote in message
...
Hi I already have an autonumber in my table and would like to have a
second
one just for certain items. Can I use the following somewhere in the
table's
definition:
dmax("FieldName", "TableName") + 1



  #6  
Old May 19th, 2010, 03:18 AM posted to microsoft.public.access
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default fake Autonumber

On Tue, 18 May 2010 08:53:01 -0700, Emma
wrote:

Oops I was mistaken and John was right. Use the expression builder and
you will see what you can and cannot do.
Populating this field in the associated form may be your best bet.

-Tom.
Microsoft Access MVP


Unfortunately it doesn't like dmax

"Tom van Stiphout" wrote:

On Tue, 18 May 2010 07:08:03 -0700, Emma
wrote:

Try setting that as the Default Value for the field.

-Tom.
Microsoft Access MVP


Hi I already have an autonumber in my table and would like to have a second
one just for certain items. Can I use the following somewhere in the table's
definition:
dmax("FieldName", "TableName") + 1

.

  #7  
Old May 19th, 2010, 09:45 PM posted to microsoft.public.access
David W. Fenton
external usenet poster
 
Posts: 3,373
Default fake Autonumber

Tom van Stiphout wrote in
:

[in expressions as default values]

Oops I was mistaken and John was right. Use the expression builder
and you will see what you can and cannot do.


But doesn't the A2010 table-level data macro change this? You can
now have your custom Autonumber run at the engine level using one,
right?

Looks like a big win to me.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 




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 08:03 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.