Increment form Number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a minor improvement I would like to make to a database I'm
constructing.

I have a recruitment database that holds candidate information and interview
information in two seperate tables, in a one to many relationship so that one
candidate may have many interviews.

Currently the process is to create a new candidate using a form and filling
in personal details, and then to click an 'interview' button which brings up
the interview form for that candidate- to fill in scheduled interview details
such as time and place. at the bottom of this form is a button 'add new
interview for this candidate' which opens a blank interview form for the
candidate it is linked to.

One of the fields I currently have to fill in on the form is 'Interview
Number' which I currently select from a list box that ranges from one to
four. Ideally what I'd like to have happen is that this number increments
automatically for each candidate as I open a new interview form.

Does anyone happen to have any suggestions that might help me out with this?

Any input much appreciated,

Thanks

Duncan
 
You can do this in the Load event of the Interviews form.
Me.txtInterviewNumber = Nz(DMax("[INTERVIEW_NUMBER]","InterviewTable", _
"[CANDIDATE_ID] = " & ???),0) + 1

Me.txtInterviewNumber = the control where you want the interview number to
display. It will also be the bound control for the interview number field in
your interview table
INTERVIEW_NUMBER = the interview number for the client
InterviewTable = the name of the table where you keep interview information
??? = Where ever the value is that will match the current candidate.
 
Fantastic, thanks very much for your help!

Duncan

Klatuu said:
You can do this in the Load event of the Interviews form.
Me.txtInterviewNumber = Nz(DMax("[INTERVIEW_NUMBER]","InterviewTable", _
"[CANDIDATE_ID] = " & ???),0) + 1

Me.txtInterviewNumber = the control where you want the interview number to
display. It will also be the bound control for the interview number field in
your interview table
INTERVIEW_NUMBER = the interview number for the client
InterviewTable = the name of the table where you keep interview information
??? = Where ever the value is that will match the current candidate.

Duncan said:
Hi all,

I have a minor improvement I would like to make to a database I'm
constructing.

I have a recruitment database that holds candidate information and interview
information in two seperate tables, in a one to many relationship so that one
candidate may have many interviews.

Currently the process is to create a new candidate using a form and filling
in personal details, and then to click an 'interview' button which brings up
the interview form for that candidate- to fill in scheduled interview details
such as time and place. at the bottom of this form is a button 'add new
interview for this candidate' which opens a blank interview form for the
candidate it is linked to.

One of the fields I currently have to fill in on the form is 'Interview
Number' which I currently select from a list box that ranges from one to
four. Ideally what I'd like to have happen is that this number increments
automatically for each candidate as I open a new interview form.

Does anyone happen to have any suggestions that might help me out with this?

Any input much appreciated,

Thanks

Duncan
 
Back
Top