Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Using DLookup to trigger a message (Access 2003 SP2)

    In the AfterUpdate event, I have this line, trying to trigger a message to let me know that this item is on backorder. I don't know if this is the right way to go about it or not. The Backordered field is a yes/no property. I am getting the message that this is the wrong number of arguments or invalid property assignment.

    If DLookup("Backordered", "tblProducts", "[ProductID] =" & Forms!sbfOrderDetails!ProductID, True) Then
    MsgBox "Testing!"


    At this point, just triggering a MsgBox is all right, but sometime when I have more time, I want to have some kind of code that will automatically export the Backordered items to a tblBackorders that is linked to OrderID and CustomerID and takes the backordered item out of the current order. I have no clue how to go about that.

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

    Re: Using DLookup to trigger a message (Access 2003 SP2)

    Your code should look like this:

    If DLookup("Backordered", "tblProducts", "[ProductID] =" & Forms!sbfOrderDetails!ProductID) = True Then
    MsgBox "Testing!"
    End If

    I don't think there's any need to move records between tables. You can use a query to select only the items in an order that are not backordered, and another query to select the items in an order that are backordered.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Moundridge, Kansas, USA
    Posts
    342
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Using DLookup to trigger a message (Access 2003 SP2)

    Thanks, HansV. I had to use Me.Parent!sbfOrderDetails for it to work. Thanks for your suggestion on the backorder issue.

Posting Permissions

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