Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    16

    Unanswered: Recordsource shifts unexpectedly

    I have a order form with two subforms on it - one shows products available, and has a button to open a "Quantity selector" form that lets the user choose a quantity and adjust the price of the product, and add it to the order. The other subform displays everything in the order.

    The problem occurs when I open one record (one order), then move to another one. If I add a product to the second order, the order jumps back to the order I first opened, rather than the order I'm working on. This happens when I close the Quantity selector form.

    I've tried using a bookmark, adding the code to the button that opens the quantity selector form, but this doesn't solve the problem - and at any rate that code has finished executing before the problem occurs.

    Does anyone know why this is happening? And if so, what I can do about it?

  2. #2
    Join Date
    Nov 2003
    Posts
    16
    I still haven't cracked this. I'm now trying OpenArgs, but can't quite figure out how to make it work. What I need to do is pass the order number of the order I'm working on from the Quantity Selector back to the Order form, and go to that record...

  3. #3
    Join Date
    Nov 2003
    Posts
    16
    Sorry to waste everyone's time - Duh! The quantity selector already knew the order ID (that's how it adds to the order). So in the code for the close button, I added code to find the relevant order. In case anyone's interested...

    Dim intOrder As Integer

    intOrder = Me.OrderID
    DoCmd.Close
    Forms![Orders 2].SetFocus
    DoCmd.GoToControl "OrderID"
    DoCmd.FindRecord intOrder

Posting Permissions

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