Just display information

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)
 
M

Michel Walsh

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
 

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