Results 1 to 3 of 3
  1. #1
    AudiA4_20T is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    28

    Question about some code in a macro

    I've been looking at this tutorial:



    https://www.accessforums.net/tutoria...urce-4331.html

    and basically he is building a macro for what he wants to do.

    What I'm confused about is in post #10

    He writes this line:

    "DCount("[CUSIP Number]","tblImportStocks")=0"

    What does that mean? Is he matching the CUSIP Number from the tblImportStocks sheet? What do "DCount" and the "=0" mean?

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Basically he is checking to see if there are any records in the table named tblImportStocks. But it could even be done simpler since you don't even need the CUSIP Number field:

    DCount("*", "tblImportStocks") = 0


    And so the message box fires if the DCount of that table shows that there are zero (0) records in it.

  3. #3
    AudiA4_20T is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jun 2011
    Posts
    28
    If there are any records? I guess this is his failsafe for if there is a problem with the external sheet he is bringing in?

    I guess what I'm asking is what does Access qualify as "records"?

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

Similar Threads

  1. Run a Embedded Macro from VBA Code
    By sabre1 in forum Programming
    Replies: 3
    Last Post: 02-25-2011, 10:26 AM
  2. Macro Question
    By jo15765 in forum Access
    Replies: 6
    Last Post: 01-20-2011, 07:53 AM
  3. Macro Question
    By Desstro in forum Programming
    Replies: 1
    Last Post: 06-18-2010, 10:05 AM
  4. Question on Macro to automate file import
    By delkath in forum Access
    Replies: 4
    Last Post: 05-25-2010, 04:28 AM
  5. how to create a macro or code to...
    By Eaglezinha in forum Access
    Replies: 1
    Last Post: 10-20-2008, 04:01 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