Results 1 to 4 of 4
  1. #1
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202

    if statement in vba to determine if table is empty


    Good morning, I am attempting to see if a temp table is empty before the end user proceeds forward. I am at a loss as how to start. I tried if isnull and looked into isempty. What I am looking for is something like this:
    IIF isnull ("tblImport_LMC_Child") then
    Call MsgBox("The child datapoint has not been imported. Please import and try again.")
    End IF

    also tried:

    Dim ImportChild As String

    ImportChild = [tblImport_LMC_Child]
    If (IsEmpty(ImportChild)) Then
    Call MsgBox("The child datapoint has not been imported. Please import and try again.")
    End If

    I am novice and am looking for some insight.
    Thank you

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Maybe try:
    Code:
    If dCount("*","tblImport_LMC_Child") Then...
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    mlrucci is offline Competent Performer
    Windows 7 64bit Office 365
    Join Date
    Apr 2018
    Posts
    202
    I just figured that out and was getting ready to post that. Works great. Thank you for your response

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 4
    Last Post: 07-18-2016, 12:59 PM
  2. Replies: 3
    Last Post: 05-27-2015, 01:17 PM
  3. Replies: 1
    Last Post: 04-14-2014, 08:20 AM
  4. Replies: 36
    Last Post: 08-19-2013, 11:38 AM
  5. Replies: 2
    Last Post: 04-23-2012, 10:13 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