Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    test to see if filedialog has been SET


    Compiler complains if I try
    Code:
    If fdMyFileDialog = Nothing Then".......
    And,

    Code:
    If IsObject(fdMyFileDialog) Then"........
    executes okay, but doesn't seem to respond even when I know if the object has been set.

    So, what's the best way to determine if the object has been set? Google "pointed" to the latter more often than not, but still.

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Not the answer you are quite seeking, but I normally set a text box to the full path of the file(or folder) as a visual clue to the end user that they have picked the correct thing, then test that for some useable contents?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    This seems to work for me:
    Code:
    Dim obFileDialog As Office.FileDialog
    
    
    If obFileDialog Is Nothing Then
    MsgBox "Not SET"
    End If
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Ah yes! Most of the time Access likes "=" and sometimes it refers "Is". Sort of depended on whether the language developers knew each other.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I think the struggle could be helped with a bit of study on comparison (logical) operators, and I'm saying that because likely there is a lot more to it than you ever imagined. WRT to = vs Is, you probably know that nothing = null, but the same can be said for Nothing, which is what we SET an object variable to when we want to empty it. Something that doesn't exist can't equal anything, can it? Thus we use Is, which can be true or false.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-07-2016, 07:11 AM
  2. Replies: 25
    Last Post: 11-23-2014, 02:43 PM
  3. Test String test besed on table data
    By igourine in forum Programming
    Replies: 3
    Last Post: 12-01-2013, 06:16 AM
  4. FileDialog
    By Tomfernandez1 in forum Programming
    Replies: 9
    Last Post: 04-13-2011, 03:45 PM
  5. Keying in Test answers to Access DB from Written Test
    By CityOfKalamazoo in forum Access
    Replies: 3
    Last Post: 03-01-2010, 08:58 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