R
rwilliams616
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
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