Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    record count (2000)

    I was wondering if someone could let me know how I programatically check to see if an Access Query in the current database has any records or not.

    I want to send the query as an attachment

    DoCmd.SendObject acSendQuery, "qryRecentNoNINOs", acFormatXLS, _
    "andy.glover@theregardpartnership.com", _
    subject:="Please chase missing Ninos", _
    messagetext:="Please see attachment", _
    editmessage:=False
    But only if the query has one or more records.

    Many thanks

    Amanda

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: record count (2000)

    Dim lngcount as long
    lngcount =Dcount("*","qryRecentNoNINOs")
    if lngCount > 0 then

    etc continue as before

    else
    msgbox("no records to send')
    end if
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    London, United Kingdom
    Posts
    152
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: record count (2000)

    Thanks John

    Just what I wanted

Posting Permissions

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