Results 1 to 6 of 6

Thread: Field Size

  1. #1
    Join Date
    Sep 2005
    Posts
    28

    Unanswered: Field Size

    In VB Code:

    How can I set the field size of the text box?

    Because I do the filter in one textbox, it can access date, vendor name, and amount. When I open the form, I do filter Vendor name first, everything is OK, when I do filter date/amount first, then filter vendor name, it has error messge "You enter value in numeric field or larger than size."

    Does anybody know that?

  2. #2
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Look in the Property Sheet for the text box. What is the format? If it is looking for a date, for example, and you enter text or a large number, it'll cause an error.

    Sam

  3. #3
    Join Date
    Feb 2004
    Location
    Irving, TX (Dallas, Fort Worth)
    Posts
    379
    Just a quick note, busy today.

    for testing numeric

    Code:
    TstRes = IsNumeric(MyTest)
    DBS4M

  4. #4
    Join Date
    Sep 2005
    Posts
    313
    So how can I fix that?

    Because I want the textbox can handle 3 datatype: Date, Amount, Text

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you can change the control size both at design and run time. I forget if there is an equivalent finction to establish whether the control is big enough for the contents

    presume you are binding the control to something like

    =format(myCurrRow,"#,##0.00p") & "; date:" & format (myDateRow,"dd-mmm-yyyy") & "; Desc:" & myTextRow

    however stylistically I don't think its a 'good' design solution, especially if you are using proportional fonts or some data may be missing or null

  6. #6
    Join Date
    May 2004
    Location
    New York State
    Posts
    1,178
    Quote Originally Posted by accessman2
    So how can I fix that?

    Because I want the textbox can handle 3 datatype: Date, Amount, Text
    The fix is fairly simple. Blank out the 'Format' line in the text box's Property Sheet, and have any data that is input to that text box 'hit' as text. Then you can use the IsNumeric() and/or IsDate() functions to test for the 'real' format. You might say something like
    Code:
    If IsNumeric(Me.txtTheTextBox) Then
        Something . . .
    ElseIf IsDate(Me.txtTheTextBox) Then
        Something Else . . .
    Endif
    Sam

Posting Permissions

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