Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2003
    Posts
    126

    Angry Unanswered: Invalid use of null

    I have a txtbox on a form that the users are suppose to enter a path and filename.

    On startup there is nothing in this box. If the user presses run then I want to check for a value in this txtbox.

    Code:
           If txtOutFile.Value = Null Then
                MsgBox "Please enter a valid path and filename." 
                Exit Sub
          End If

    How can I make this work?

    Thanks Ken

  2. #2
    Join Date
    Oct 2002
    Location
    Greensboro, NC
    Posts
    50

    Re: Invalid use of null

    Try this
    If ISnull(txtoutfile) then
    msgbox
    exit sub
    end if



    Originally posted by GA_KEN
    I have a txtbox on a form that the users are suppose to enter a path and filename.

    On startup there is nothing in this box. If the user presses run then I want to check for a value in this txtbox.

    Code:
           If txtOutFile.Value = Null Then
                MsgBox "Please enter a valid path and filename." 
                Exit Sub
          End If

    How can I make this work?

    Thanks Ken

  3. #3
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    the code should be:

    if isnull(me.txtOutFile) = true then
    MsgBox "Please enter a valid path and filename."
    Exit Sub
    End If

  4. #4
    Join Date
    Jan 2003
    Posts
    126
    Thanks guys! Both work just fine, I knew I was missing the boat on this one.

    Thanks much!

    Ken

Posting Permissions

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