Results 1 to 8 of 8
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error run time 94 (2000 sr 1)

    why have this error when the textbox filled with recod?
    Not important for me if the value is null or not(?!)...

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: error run time 94 (2000 sr 1)

    The Text property of a text box is a String. Strings cannot be Null. Try this:

    If Not IsNull(RSD("NDG")) Then
    BOXNDG.Text = RSD1("NDG")
    End If

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error run time 94 (2000 sr 1)

    hummmm....
    ok for suggestion....
    but i have 23 or 25 textbox where i spossible to have the same condition.. i must repeat fro all to the hand or exitstis other way?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: error run time 94 (2000 sr 1)

    I'm afraid you'll have to repeat this for all text boxes. Or you could imitate the Nz function from Access: create the following function in a module:
    <code>
    Public Function Nz(MyVar As Variant) As String
    If IsNull(MyVar) Then
    Nz = ""
    Else
    Nz = MyVar
    End If
    End Function
    </code>
    You can then use
    <code>
    BOXNDG.Text = Nz(RSD1("NDG"))
    </code>
    You will still have to do this for all text boxes, but it's less work than repeating If ... Then for each of them.

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error run time 94 (2000 sr 1)

    naturally!!!!
    Work fine!
    Tks.

  6. #6
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error run time 94 (2000 sr 1)

    Question: Why does the Nz function have to be imitated? Isn't it available in this context?

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: error run time 94 (2000 sr 1)

    Although Sal21 doesn't state it explicitly in his post, I know from previous posts that he is developing an application in VB6 that uses data from an Access database. The Nz function is specific to Access VBA, it is not available in VB6.

  8. #8
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: error run time 94 (2000 sr 1)

    Thanks for the explanation; I should have deduced that the code was not Access VBA from your sentence:
    "Or you could imitate the Nz function from Access:"

Posting Permissions

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