Results 1 to 5 of 5
  1. #1
    terjeo is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11

    Red face Making blank field invisible

    Hi.


    I am new to VBA and try to find out how I can make a blank field invisible. (There is no data in the blank field).
    I try this: (the field name is "Brand")

    Code:
    If Me.Brand = ???? then
    Me.Brand.Visibe = False
    Else
    Me.Brand.Visible = True
    
    End If
    With what shall I replace the question marks?

    Thank you for all help

  2. #2
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Code:
    If IsNull(Me.Brand) Then
    ...
    or if it is an empty string
    Code:
    If Me.Brand = "" Then
    ...
    https://www.google.com/search?client...d&q=vba+isnull

  3. #3
    terjeo is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    Yes, This is it.

    Thanks so much

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    you can simplify your code to

    Me.Brand.Visible=Me.Brand <> ""

  5. #5
    terjeo is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    Thank you for the tip. I will memorise this

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

Similar Threads

  1. Making buttons visible and invisible
    By banpreet in forum Programming
    Replies: 4
    Last Post: 07-29-2016, 08:43 AM
  2. Replies: 3
    Last Post: 08-07-2014, 08:48 AM
  3. Replies: 7
    Last Post: 12-12-2013, 07:11 PM
  4. Making a Command Buttong Visible/Invisible
    By Lupson2011 in forum Forms
    Replies: 3
    Last Post: 02-16-2012, 12:03 PM
  5. Making subform field visible/invisible
    By Snufflz in forum Forms
    Replies: 3
    Last Post: 01-17-2011, 05:30 AM

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