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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

consecutive default values in table?



 
 
Thread Tools Display Modes
  #1  
Old July 10th, 2004, 09:08 PM
beejsnyder
external usenet poster
 
Posts: n/a
Default consecutive default values in table?

I'm fixing an existing database. The primary key is a numerical field, consecutive, and the owners would like the next number in line to auto-populate in that field when they enter a new record.

I'm pretty sure this is achieved via default value, but haven't been able to find the proper expression? Tried this: =DMax("[FieldName]","TableName")+1
....and was returned an error message.

Other things that might make a difference: previously created records have since been deleted (when sold) so the list is not complete anymore. Also I'm using MSOffice Professional 2000. Any help in creating the default value expression to just tell the form "this number is the same as the previous record plus 1" would be SO APPRECIATED!
  #2  
Old July 10th, 2004, 09:38 PM
Douglas J. Steele
external usenet poster
 
Posts: n/a
Default consecutive default values in table?

AFAIK, it's not possible to set use DMax in setting a field's DefaultValue
in a table.

You can, of course, do this when using a form to update the table, though,
so it shouldn't matter, since you should never be updating tables directly.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"beejsnyder" wrote in message
...
I'm fixing an existing database. The primary key is a numerical field,

consecutive, and the owners would like the next number in line to
auto-populate in that field when they enter a new record.

I'm pretty sure this is achieved via default value, but haven't been able

to find the proper expression? Tried this:
=DMax("[FieldName]","TableName")+1
...and was returned an error message.

Other things that might make a difference: previously created records

have since been deleted (when sold) so the list is not complete anymore.
Also I'm using MSOffice Professional 2000. Any help in creating the default
value expression to just tell the form "this number is the same as the
previous record plus 1" would be SO APPRECIATED!


  #3  
Old July 10th, 2004, 09:56 PM
beejsnyder
external usenet poster
 
Posts: n/a
Default consecutive default values in table?

Mr. Steele, you are quite literally my hero!!! Until my next crisis...

Thanks again!!

beejsnyder

"Douglas J. Steele" wrote:

AFAIK, it's not possible to set use DMax in setting a field's DefaultValue
in a table.

You can, of course, do this when using a form to update the table, though,
so it shouldn't matter, since you should never be updating tables directly.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"beejsnyder" wrote in message
...
I'm fixing an existing database. The primary key is a numerical field,

consecutive, and the owners would like the next number in line to
auto-populate in that field when they enter a new record.

I'm pretty sure this is achieved via default value, but haven't been able

to find the proper expression? Tried this:
=DMax("[FieldName]","TableName")+1
...and was returned an error message.

Other things that might make a difference: previously created records

have since been deleted (when sold) so the list is not complete anymore.
Also I'm using MSOffice Professional 2000. Any help in creating the default
value expression to just tell the form "this number is the same as the
previous record plus 1" would be SO APPRECIATED!



 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
default values Glenn Causey New Users 3 July 19th, 2004 12:21 PM
Default placement for data values in Charts Ellen Powerpoint 2 July 14th, 2004 03:56 PM
STORE multiple values from a lookup table beller Database Design 2 June 16th, 2004 04:16 AM
resize table from A4 size to A5 ims New Users 3 June 9th, 2004 01:05 AM
Change Default Pivot Table Summary Larry Kayser Worksheet Functions 1 March 24th, 2004 09:54 PM


All times are GMT +1. The time now is 07:36 AM.


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