+ Reply to Thread
Results 1 to 6 of 6

variable not capturing the "0" from user-entered info

  1. #1
    Registered User
    Join Date
    07-12-2007
    Posts
    16

    variable not capturing the "0" from user-entered info

    I'm querying an oracle ODBC database. the code is working fairly well, but my issues with that are in another thread. This thread is regarding the following:

    step 1) Dim ProjectNo as Integer (I've used String to try to fix the problem, too)
    step 2) user enters project number in text box on UserForm
    step 3) ProjectNo=txtbox.value
    step 4) Query uses "ProjectNo" to query the ODBC database.
    step 5) Query returns values

    My issue is this: If the project number starts with a "0," the variable does not capture that "0."

    EXAMPLE:
    User enters "0121" in text box and the query returns anything with a "121" in it. (e.g. 0121, 1121, 1215, etc)

    So the data is convoluted and contains some correct info, but also some superfluous information as well.

    Is there any way I can capture that zero in the variable?

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Did you try:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-12-2007
    Posts
    16
    Just tried it... still getting a variable value with no zero.
    Thanks though!

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    I think we need to see your actual code.

  5. #5
    Registered User
    Join Date
    07-12-2007
    Posts
    16
    Oh but you just fixed the problem altogether, because now with:

    Please Login or Register  to view this content.
    I tried entering the full project number (it happens to include a letter in it, e.g. N0121) and it doesn't give me any sort of error like it was doing before with the text box declared as a "Value" not "Text."

    That's better than fixing my original problem!

    Thanks a ton

  6. #6
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    I'm glad I could [indirectly] help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1