|
-
Sep 14th, 2009, 07:07 PM
#1
Thread Starter
Lively Member
MaskEdBox format
hi guys.. kindly help me in this one... i'm creating an inventory system.. i have a problem in their Item No. format... i use maskedbox... my mask is ##-####### ... im using a barcode reader..their current Item number has only 4 digit... i want the output will become this one >>> 00-00005597..... and it will start on the right side... 5597<<< item number... and how i put the "0"?
thanks in advance
-
Sep 14th, 2009, 08:21 PM
#2
Thread Starter
Lively Member
Re: MaskEdBox format
i already know how to put the "0"... just change the prompt char to "0".... am i right? now my only problem is how to input right to left..
thanks
-
Sep 16th, 2009, 09:36 PM
#3
Thread Starter
Lively Member
Re: MaskEdBox format
someone give me this code
vb Code:
MsgBox Format("4321", "00-00000000")
it is working...but its for msgbox only.. who will apply this to maskedbox?
-
Sep 16th, 2009, 09:51 PM
#4
Re: MaskEdBox format
change your mask... from # to 0 ... that's all.
-tg
-
Sep 16th, 2009, 10:03 PM
#5
Thread Starter
Lively Member
Re: MaskEdBox format
i already do that.. but it didn't start on the right side..
here's the format >>> 00-00000000.... when i type this "1234"... the output must be... 00-00001234..
-
Oct 5th, 2009, 05:29 AM
#6
New Member
Re: MaskEdBox format
Hi,
Something you could try is to validate the barcode information. If the string from the barcode is less than the string you want, run it through a converter. Something like this:
Code:
Private Function ValidateBarcode (strBarCode as string) as string
If strBarCode.length < 8 then
ValidateBarcode = format (strBarCode, "00-000000")
Else
ValidateBarcode = strBarCode
End If
Return ValidateBarcode
End Function
Hopefully this helps and I didn't make any mistakes in the language. I'm at work and not near my development machine right now, so I couldn't validate any of the code. But this gives you the general idea of how to make the this work.
Robert
edit: Made change to Code section for clarity (strBarCodeInfo was not correct variable).
Last edited by RobMoore; Oct 6th, 2009 at 04:32 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|