Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Criteria for message (Access 2000)

    On starting a new order in the main form, I want after choosing the customerid to open a message box saying “ Attention the customer has unpaid invoices”. I have built a query called "qryUnpaidByCustomer" for this purpose :
    SELECT Customers.Customerid, Count(orders.orderid) AS CountOforderid
    FROM Customers LEFT JOIN orders ON Customers.Customerid = orders.customerid
    WHERE (((orders.paid)=False))
    GROUP BY Customers.Customerid;

    How could I use the Dlookup function and how could I build the message box ?

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: Criteria for message (Access 2000)

    Try this:

    If DCount("*", "qryUnpaidByCustomer", "Customerid=" & Me.Customerid) > 0 Then
    MsgBox "Attention! This customer has unpaid invoices.", vbExclamation
    End If

  4. #3
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Criteria for message (Access 2000)

    Thanks ! I have applied it already and the effect is great !

Posting Permissions

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