Results 1 to 3 of 3
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Requery? (2002 SP-2)

    I should know how to do this (maybe not enough coffee yet). I have frmOrderDetail with cmdDeliveryException which opens the frmDeliveryException. Both forms are based on the same table. Opening frmOrderDetail and then selecting cmdDeliveryException allows the operator to enter a memo concerning delivery exceptions - no problem, works just fine. However, if the operator makes any changes to frmOrderDetail before selecting cmdDeliveryException they get a message that the record is in use by another user. I suppose this occurs because frmOrderDetail needs to close (or requery) before frmDeliveryException attempts to update the same table. I just can't remember how to do that. The cmdDeliveryException 'onclick' event is:

    Private Sub CmdDeliveryExceptionForm_Click()
    On Error GoTo Err_CmdDeliveryException_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frmDeliveryException"

    stLinkCriteria = "[ProNo]=" & Me![ProNo]
    DoCmd.OpenForm stDocName, , , stLinkCriteria

    Exit_CmdDeliveryException_Click:
    Exit Sub

    Err_CmdDeliveryException_Click:
    MsgBox Err.Description
    Resume Exit_CmdDeliveryException_Click
    End Sub

    As always, any assistance is greatly appreciated!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

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

    Re: Requery? (2002 SP-2)

    Why not display the memo field on frmOrderDetail? You can organize the controls using a tab control to avoid clutter.

    When you open another form based on the same table, you must make sure that the record has been saved in frmOrderDetail before opening frmDeliveryException. I also recommend opening frmDeliveryException as a dialog form to ensure that the user can't go back and forth between the two forms. To do this, adapt the code as follows. Added/modified code is bold.

    ...
    stLinkCriteria = "[ProNo]=" & Me![ProNo]
    If Me.Dirty Then RunCommand acCmdSaveRecord
    DoCmd.OpenForm stDocName, , , stLinkCriteria, , acDialog
    ...

    Explanation:
    Me.Dirty is true if the record has been modified. If so, the record is saved using RunCommand acCmdSaveRecord.
    I have specified the WindowMode argument of OpenForm as acDialog. This means that the user must close the form before continuing to work in other parts of the database. Clicking outside the window won't work.

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: Requery? (2002 SP-2)

    Thanks Hans, it works perfectly!

    The reason for the seperate form is that the memo is text intensive. Delivery exceptions track each and every phone call (and the jest of the conversation) associated with contacts with customers, drivers, and staff over a period of what may amount to several days. This often results in numerous lines of text and displaying this info in its entirety (or at least a major portion of it) requires the whole screen. I do, however, follow your logic in doing it on the same form.

    Thanks Again!!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

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