PC Review


Reply
Thread Tools Rate Thread

Default value for subform records

 
 
=?Utf-8?B?cndpbGxpYW1zNjE2?=
Guest
Posts: n/a
 
      17th Jul 2007
I have a form (frmFRACAS) that is fed by a table called tblFRACAS. Within
frmFRACAS I have a subform called frmFiles, which is fed by tblFiles.
tblFRACAS has a primary key (LogNo) that is a number field.

LogNo is also used in tblFiles. Also in tblFiles I have a FileNo number
field. I have created a relationship between tblFRACAS and tblFiles.

The idea is to use the subform to list files associated with each LogNo. I
am trying to have my database automatically assign a number for each file,
starting over at 1 for each LogNo. Each LogNo can have zero, one, or more
FileNo associated with it. For example, LogNo 1 can have FileNo 1 and 2, and
LogNo 2 can have FileNo 1 (which is different than LogNo 1 FileNo 1).

In the "Default Value" field for FileNo, I have put the following:

Nz(DMax("LogNo!FileNo","Files")+1,1)

Apparently the DMax portion of the statement is returning null because all
new records have a FileNo of 1. Can anyone see anything obvious in my
methodology that should be fixed?

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subform Default Records GaryS Microsoft Access Form Coding 11 8th May 2009 03:47 PM
Default records in a Subform - Help CD Microsoft Access 3 18th Dec 2008 05:57 PM
If no record, show default subform 'no records' Jeff Microsoft Access Form Coding 4 14th Oct 2005 12:50 PM
Default Values for Records on a subform =?Utf-8?B?dG1vcnQ=?= Microsoft Access VBA Modules 0 4th May 2005 08:51 PM
Subform Default Key Value when adding new records to table James Microsoft Access Forms 5 17th Jun 2004 05:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:47 AM.