Results 1 to 3 of 3
  1. #1
    dickn is offline Novice
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Victoria BC, Canada
    Posts
    15

    Question Reopen a form from within the same form

    I have a complex application with an order form for viewing an existing customer's orders and initiating new orders. While viewing one order I can opt to open a new order. I used to Close the form and then reopen it with the new order number as part of the "New Order" procedure. This caused a slight delay due to the complexity of the form. Then I tried skipping the "Close" and just reopen the form with the new order number. Worked like a charm. This action appears to update the current record and then open the new one which runs the "Form_Current" procedure but not the "Form_Open" or "Form_Load". To be certain that the current record is updated I do a "Me.Dirty = False" before the Docmd.Openform.

    Then I thought that using "Me.RecordSource = "SELECT * FROM etc. WHERE OrderNum =" & varorder
    would be better somehow. I tried it in a couple of places (procedures that do a "Next" and "Previous" to step through the current orders) but not in the "New Order" procedure just as an experiment. Worked just fine, but not a lot faster, for the "Next" and "Previous" procedures. But when I clicked on "New Order" I had a completely blank form!! It's as if the "DoCmd.Openform etc. OrderNum =" & neworder did not get the record!!

    I watched the "Me.RecordSource" go through "Form_Current" just like a "DoCmd.Openform so it looked like it was doing the same thing. But there is obviously a subtle difference that eludes me. It's like the recordset for the form has been forgotten. But how? And if so, how to get it back?



    Just curious, because I went back to the "DoCmd.Openform" in all places and it works fine.
    Last edited by dickn; 07-16-2014 at 01:42 PM.

  2. #2
    eki einstein's Avatar
    eki einstein is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Jan 2013
    Location
    Bekasi - Jawa Barat- Indonesia
    Posts
    26
    do you have check the form properties ? Data > data entry if you set to yes then the form will allways do add a new record method when its open... i think you should create two form just copy paste it and you give the proerties to each form yes and No method so the add new record form are deferent whit the Edit/View one, but whit exactly have same form design

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Cannot open a form as its own subform.

    Can open it independently. Review http://allenbrowne.com/ser-35.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Anchoring controls on a form reset on reopen
    By bayners123 in forum Forms
    Replies: 8
    Last Post: 04-13-2014, 10:03 AM
  2. Replies: 8
    Last Post: 04-12-2014, 01:29 PM
  3. Replies: 3
    Last Post: 04-09-2013, 01:35 PM
  4. If no matches Reopen form after Msgbox
    By LoveLearning in forum Access
    Replies: 2
    Last Post: 07-18-2012, 06:08 PM
  5. Replies: 9
    Last Post: 03-29-2011, 07:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums