Form field

N

Naz

Hi

I'm stuck on a problem with an archiving database that i am working on.
I have a basic form that captures the relevant information and each file
within each box has a unique RMS number but many files can fit into one box.
So the problem is although i can increment the RMS number, if more than 1
files is going in the same box how can i make the next record aware of that.
So far i have created 2 buttons on the form a new box button which
increments the box number and the RMS number and an add file button which
should increment the RMS number but not the box number. My code is below


=====================================================
Private Sub AddFile_Click()

On Error GoTo Err_AddFile_Click


DoCmd.GoToRecord , , acNewRec
Me.RMS_FILE_REF = DMax("[RMS_FILE_REF]", "tbl_FileInfo") + 1


Exit_AddFile_Click:
Exit Sub

Err_AddFile_Click:
MsgBox Err.Description
Resume Exit_AddFile_Click

End Sub

=====================================================

Private Sub NewBox_Click()
On Error GoTo Err_NewBox_Click


DoCmd.GoToRecord , , acNewRec
Me.RMS_FILE_REF = DMax("[RMS_FILE_REF]", "tbl_FileInfo") + 1
Me.WANDSDYKE_BOX_NO = DMax("[WANDSDYKE_BOX_NO]", "tbl_FileInfo") + 1

Exit_NewBox_Click:
Exit Sub

Err_NewBox_Click:
MsgBox Err.Description
Resume Exit_NewBox_Click

End Sub
--

The new box one works as expected but the NewFile one i am stuck on how to
finish of..at first i thought of storing the max box number when a new box is
created and using that to populate it but got stuck there as well..... The
database will be used by many people so does that make my problem worse as
well..................can anyone help?



_______________________
Naz,
London
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top