magicmandan
Programmer
- Mar 9, 2010
- 13
Hi,
I have an identification number (PRNid) stored as a integer in the underlying table.
On a data entry form i have a textbox with the control source set to PRNid.
I want to keep this number as an integer but when ever it is displayed on a form or report it need to take the format "N000" - without the quotation marks (e.g. PRNid 1 would be displayed as N001, PRNid 55 would be displayed as N055 etc).
For any reports where PRNid is displayed I know I can just format the field using the following syntax:
fPRNid = "N" & format([PRNid], "000")
However for the purpose of data entry how do I set up the textbox input mask and format properties so that;
a) if a PRNid of 1 has already been entered but the field does not have focus it is displayed as "N001".
b) when the textbox receives focus for new PRNid entry the input mask takes the form of N000 (where N is non editable and the zeros can be overwritten with numbers only).
c) when the textbox receives focus for an existing PRNid of 1 the input mask displays N001 with the same functionality as b) (including leading zeros)
Any help would be appreciated.
I have an identification number (PRNid) stored as a integer in the underlying table.
On a data entry form i have a textbox with the control source set to PRNid.
I want to keep this number as an integer but when ever it is displayed on a form or report it need to take the format "N000" - without the quotation marks (e.g. PRNid 1 would be displayed as N001, PRNid 55 would be displayed as N055 etc).
For any reports where PRNid is displayed I know I can just format the field using the following syntax:
fPRNid = "N" & format([PRNid], "000")
However for the purpose of data entry how do I set up the textbox input mask and format properties so that;
a) if a PRNid of 1 has already been entered but the field does not have focus it is displayed as "N001".
b) when the textbox receives focus for new PRNid entry the input mask takes the form of N000 (where N is non editable and the zeros can be overwritten with numbers only).
c) when the textbox receives focus for an existing PRNid of 1 the input mask displays N001 with the same functionality as b) (including leading zeros)
Any help would be appreciated.