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. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 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

  3. #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
  •