Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is Null (Access 2000)

    If IsNull


    I want to make my command button Cmd2 invisible in case the table TblOrders is
    deleted ot not imported in the database.
    Can i use the If IsNull in that case and how can i do make it?

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

    Re: Is Null (Access 2000)

    No. IsNull relates to data in tables, not to the existence of tables themselves. You can use the hidden system table MSysObjects to find out whether a table exists, for example in the On Load event of your form:
    <code>
    Private Sub Form_Load()
    Me.Cmd2.Visible = (DCount("*", "MSysObjects", "Type=1 AND Name='tblOrders'") > 0)
    End Sub
    </code>
    Records with Type=1 in MSysObjects are local tables. Note the single quotes around the table name.

Posting Permissions

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