Results 1 to 5 of 5
  1. #1
    harrie is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    8

    return text value using ISNULL

    how can i do when the box txtRental is empty then the txtStatus shows a text 'available'.



    My code :::

    Private Sub txtStatus_Click()


    If IsNull(Me.txtRental) Then
    txt.status = available
    Else
    txt.status = unavailable
    End If
    End Sub

    the code is not correct T..T . Pls hlp me to correct it

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    It needs to look like this:
    Code:
    Private Sub txtStatus_Click()
    
        If IsNull(Me.txtRental) Then
            Me.txtStatus = "available"
        Else
            Me.txtStatus = "unavailable"
        End If
        
    End Sub

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    You MUST put quotes around the words....
    "available"
    "unavailable"

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You MUST put quotes around the words....
    "available"
    "unavailable"
    The references to the "txtStatus" fields were also bad (as corrected in my post).

  5. #5
    harrie is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2016
    Posts
    8
    ok,thx a lot

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 02-24-2016, 10:58 PM
  2. Replies: 8
    Last Post: 07-14-2014, 04:02 PM
  3. Return text after a string
    By Madmartigan in forum Queries
    Replies: 11
    Last Post: 03-04-2014, 03:20 PM
  4. check and return specified text
    By nosiss in forum Queries
    Replies: 7
    Last Post: 05-17-2011, 02:29 PM
  5. Replies: 1
    Last Post: 11-05-2010, 04:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums