Return Prefix Based on Year

beanie_d83

Registered User.
Local time
Today, 05:53
Joined
Feb 5, 2013
Messages
29
Hi all,

I'd like to know how to return a prefix based on year to a text box in a form.

Each trailer we build will have this code on it, much like a vin plate on a car and the prefix will change when a new year begins and the numbering will start again from the beginning.

For example the year prefix for 2016 is J follow by 001, 002 etc etc.

I have created a table with the following:

tbl_ProductionYear

YearID (PK)
Year
YearPrefix

Ideally I would like to combine this prefix with the production number into one text box but I'm not savvy enough to know how to do this so I have used 2 text boxes and just placed them next to one another!
 
create a new Calculated text field, for the calculation just type the following:

[YearPrefix] & [YearID] this will display G1
 
Hi Ryker,

do I just need to type this into the text box I want it to appear in then?

Thanks again for your help
 
open the table, go into design view on the table. then select that new field you created and look at the bottom there is a expression, type it in there.


Hope this helps
 
Ok well I've got so far but when it comes to typing the expression it tells me it can't find YearPrefix
 
attach your accessdb, and ill take a look at it.
 
Hi Ryker,

here is the db.

So far when a dealer is selected, 00 appears in the text box but not the year prefix.

I also need the serial number and the production code to run concurrently with each other each time a record is created but the serial number does not appear.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom