Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

prefix formatting for an Auto number field 1

Status
Not open for further replies.

justagrunt

Technical User
Oct 10, 2002
132
0
0
Hi,
Is it possible to automate the selection of a prefix for an Auto numbering field.
On the form the text box format is >"BO" which does nicely and adds a prefix to create 'BO6953" etc and this appears in the table.
If I have say 6 prefixes that are required, can the choice be automated to allow selection of one of these prefixes to alter the field format and set it for that moment?
So that each time the form opens a prefix selection is required which sets the text box format for the autonumber field.
If so - How???????
Any pointers and suggestions appreciated.
Warm Regards
Bill
 
I imagine, in the appropriate event;

Form_Before/AfterInsert()
SElect case ....
Case 5: Me.pkId.Format = ">BO"
Case 6: Me.pkId.Format = ">FO"
Case 3: Me.pkId.Format = ">BR"
End Select



Form_Current
If Me.NewRecord = True Then
SElect case ....
Case 5: Me.pkId.Format = ">BO"
Case 6: Me.pkId.Format = ">FO"
Case 3: Me.pkId.Format = ">BR"
End Select
End If
 
Cheers.
Great thanks.
Beaut.
And all other ways to say thanks.
Warm Regards
Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top