Hi all,
I have a small problem which I'm hoping is easy to fix:
I have a textbox called JobNoTextBox.
The only format allowed in this box is 2 letters followed by 6 numbers. i.e "AB123456".
I need to automatically format the text if someone enters a value which is not in this format.
Example: Someone enters "AB12345" the code will automatically change it to "AB012345".
This is the code I have tried:
but it just changes the text to "AB000000" no matter what.
Can someone help please?
thanks
John
.NET 2.0, Visual Studio 2005, SQL Server 2005 Express
I have a small problem which I'm hoping is easy to fix:
I have a textbox called JobNoTextBox.
The only format allowed in this box is 2 letters followed by 6 numbers. i.e "AB123456".
I need to automatically format the text if someone enters a value which is not in this format.
Example: Someone enters "AB12345" the code will automatically change it to "AB012345".
This is the code I have tried:
Code:
JobNoTextBox.Text = Microsoft.VisualBasic.Left(JobNoTextBox.Text, 2) & Format(Microsoft.VisualBasic.Mid(JobNoTextBox.Text, 3, 6), "000000")
Can someone help please?
thanks
John
.NET 2.0, Visual Studio 2005, SQL Server 2005 Express