Just display information

  • Thread starter Thread starter McDonald
  • Start date Start date
M

McDonald

Hello,
I have a form where I just want to display information. i.e. AV-2003-046.
Where AV is the facility code 2003 is the year and 046 is the case number.
This is how we track our clients. In the clent table I have an autonumber
that is the primary key. This case number is just put together by selecting
the facility, the year and the consecutive number of that year. What I
would also like to do is have a cmdbutton that when pushed generates a new
record with this information already filled in. i.e. the facility AV the
year automatically and the next number (Like an autonumber)
 
Hi,



If you have three fields, facility, yearData and CaseNumber, and,in the
form, have specify the Facility to look for, still assuming the current
year, Year( Now ) supply the year to look for, then, the next case number
can be obtained with something like:

1+ Nz(DMax("caseNumber", "tablenameHere",
"Facility=Forms!FormNameHere!Facility AND YearData=Year(Now)"), 0)



Note that under those assumptions, the caseNumber are different running
sequences by facility, by year.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top