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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prefixing???

Status
Not open for further replies.

Turb

Technical User
Feb 11, 2003
154
US
All,
Is there a way to prefix a textbox on a form and save to the underlying table?
For example: The user inputs "1234" in the form textbox, and it is saved in the table as "abcd-1234".
I tried placing "abcd-" in the format field in the textbox properties, but the "abcd-" never gets saved to the table.
If it matters, I use a SQL query to save all the data from the form.
Thanks in advance!

Ind. Engineering Tech.
 
Use the SQL query to add the prefix.

example:

SELECT ('212-'+ Phone)As AreaCodePhone
FROM Employees

You can use a similar statement for UPDATE/INSERT
 
The other option would be to set up an input mask for the text box like the one below:

"abcd-"0000;0;_


The users would enter the 4 digits but the abcd would be prefixed and stored in the underlaying table.


HTH,

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top