Results 1 to 6 of 6

Thread: MaskEdBox format

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    97

    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

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    97

    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

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    97

    Re: MaskEdBox format

    someone give me this code
    vb Code:
    1. MsgBox Format("4321", "00-00000000")

    it is working...but its for msgbox only.. who will apply this to maskedbox?

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: MaskEdBox format

    change your mask... from # to 0 ... that's all.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2009
    Posts
    97

    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..

  6. #6
    New Member
    Join Date
    Oct 2009
    Location
    Michigan
    Posts
    6

    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
  •  



Click Here to Expand Forum to Full Width