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

input mask - combo fill (from left to right and right to left)

Status
Not open for further replies.

PDAnalyst

Technical User
Dec 2, 2005
72
US
Hello,

I have a unique situation.

I need to create an input mask that will force the user to enter a specific incident number in certain way. This input mask has to fill from both left to right and left to right for certain sections of the Incident number. This will allow user not to prefill certain digits with zeros.

Example: Incident number is 07-123456, the user will enter 07123456 and it will fill the correct format.

This is easy to do by using the !\00-000000 mask

The problem is that when the incident number is 07-000001, I want the user to only enter 071 and I want it to prefill the zeros (such as 07-000001)

I have looked high and low but cannot find any way to get this done.

Any help is appreciated,

Thanks

Safa
 
Remou,

That works good, except that if I happen to select an incorrect ProcessID, and then select the correct one, the original textboxes that were hidden do not reappear.

Thanks,

Brian
 
Is this a case of Postus-interruptus? Is Remou using Stealth Posts?

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Hi,

You could try doing a format on the after update for the number: format(your number, "000000"). You will need to do something else with this, but I don't know what sorry.

Im not an expert myself at all and thats all the help I can give! I would suggest reposting this thread though to get a better chance of your problem being answered, as people have already puts posts into this thread (albeit posts that dont relate at all to what you want) and so other people looking at the main thread board will see it as "answered" or "being answered", if you see what I mean.

Andrew
 
Hi again,

I dont know how to do this but here is a suggestion I just thought of. What you could do is somehow split the number that has been entered up into 2 digits and then the rest, and assign these to two different variables (in the after update event of the field), say number1 and number2.

A few examples being, user enters 071, then number1 equals 07 and number2 equals 1. User enters 071234, number1 equals 07 and number2 equals 1234.

What you would do then is put these two variables into a format as in the below code :

Code:
dim number1 as integer
dim number2 as integer

number1 = Some sort of cut out here(Me.Number)
number2 = The rest of the number

Me.Number = Format(number1, "00") & "-" & Format(number2, "000000")
Where Me.Number is your field the user enters the number, and the number1 = .../number2 = ... are as described above.

Im sorry I cant help you with how to actually disect the original number, but its a start!

Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top