Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35

    Updating Main form from a popup form

    I have a query which joins three forms, a main form called AppointmentsF, and two pop up small forms one called ExtrasF and the other DepositsF. The AppointmentsF form has an autonumbered ID field which is linked on a one to one basis to numbered IDs on both of the two pop up small forms. I only occasionally need to use the pop up forms, on about 5% of occasions, which is why they are pop up forms linked to the main form rather than embedded in the main form - size considerations!


    The pop up forms contain fields which need to be reflected in calculated fields of the main form, a field that calculates the total value taken from the main and pop up forms (where they exist) and concatenates strings taken from one of the pop up forms where those strings exist.
    I can only access the pop up forms from buttons on the main form which take me to the related pop up form.
    When I close the pop up forms, which have to be closed by using a small button before the Main Form can be closed, and despite having a procedure in the on click event of the button used to close the pop up form (namely:

    Me.Refresh
    Forms!AppointmentsF.Recalc
    )
    and with similar code, (namely

    Me.Refresh
    Forms!AppointmentsF.Refresh
    )
    on each field that is used to calculate the total value or concatenate a string, I cannot get the AppointmentsF form to show the recalculated values.

    If I close the AppointmentsF form, having first closed either or both of the pop up Forms, and then reopen the AppointmentsF form everything is correct. The Totals are correct and the Concatenated String is showing correctly.

    How do I force the AppointmentsF form to show the updated total value and the concatenated string (where it arises) without having to close and reopen it? What am I doing wrong?

    Many thanks

    David

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Try the Requery method
    Forms!AppointmentsF.Requery
    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.

  3. #3
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    Unfortunately the Requery method does not work either. At one time I get very excited as it seemed it was working, but then when I clicked on the close button it did not close the small modal form and I had to use the 'x' button to do so, but it did close the main form! It now seems, and I find this incredible, that if I have exited the small modal already in the session it will work when I fire it up again, but not when I first fire it up, although I have not tried that having made no entries on the small modal form.
    The first time I tried it the main form was closed and re-opened at a new record, which is not what I want at all.
    I have therefore removed the requery from the close button since that does not assist in a logical and coherent manner.
    Thanks anyway, but it did not succeed.
    David

  4. #4
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    I think I have worked out what is the problem, but I am not sure how to solve it.
    The data on the main form has not been saved before I open the pop up form, and if it has then everything works just fine, but if it has not, then I have a problem, so how do I save the data entered into the main form first?
    I have tried : If Me.Dirty = True Then Me.Dirty = False
    but that does not work, so should I use a docmd and if so which should I use?
    I have tried If Me.Dirty And Nz(Me![ApptCustomerName], "") <> "" Then DoCmd.RunCommand acCmdSaveRecord
    but that doesn't work either.
    I put a me.requery after that and ran into real problems.
    Can anyone help?
    Many thanks
    David

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Good point, I should have recognized that since the main form remains open, the record is not fully committed. The trick is figuring out where to put the SaveRecord code. I am thinking in the button click event that triggers the popup. It's how I have accomplished this.
    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.

  6. #6
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    Thank you for your help.

    I have the SaveRecord code in the button click event that triggers the popup, but I still do not get the update to the Main Form when I make alterations in the popup Form.
    Further, if I shut the Main Form and then reopen it before I make the alterations I still do not get the update to the Main Form when I make alterations in the popup Form.

    But, if I make alterations in the popup Form, and then close it and the Main Form, and then open both again, the alterations I make in the popup Form are reflected in the Main Form. It is weird.
    I think I will have to live with it because I cannot think what else to try.
    I should, perhaps, add that the Main Form is a data Entry Form primarily with a secondary use for viewing, and also altering, individual existing data.
    Anyway thanks for your help.
    David

  7. #7
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Using a form for those multiple purposes is fine. I do that a lot.

    You have two things going on here.

    1. Data entry to new record in the main form. Since the form remains open this needs the SaveRecord action.

    2. Data entry by the popup. Closing the popup commits edits/new record. Then need to Refresh or Requery the main form.

    I do all of these behaviors in my projects. If you want to make yours available for analysis, at least the objects of issue, then attach to post or upload to fileshare site such as box.net and post link to the file.
    Last edited by June7; 06-04-2011 at 02:18 PM.
    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.

  8. #8
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    Thank you for the kind offer. I would love to attach the file but it is too large, so I could put it into DropBox, but without your email address I cannot invite you to DropBox. Would you be kind enough to email me your address. Mine is wdrspens as the name using gmail.com. I have put it like that to avoid any mechanical lifting of my address!
    I am in the UK and am now retiring to bed, so will not be able to do anything until tomorrow.
    Kind regards
    David

  9. #9
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    Can upload to box.net in a ShareAll folder and post link to the file then anyone can view it. Remove confidential data from the tables (phone, address). That or make new project and import only objects of issue and delete most records. That should be small enough to attach to post. Either way, be sure to run Compact and Repair first.
    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.

  10. #10
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    I have a problem with uploading to somewhere where all can view the file. The program is one I purchased albeit with a licence to alter the code to my requirements (see http://www.accesstogo.org.uk/Appointments_Planner.html) and I cannot give general access to the code.
    I am trying to convert the database to a similar idea but without the purchased code, and am getting there, but it is taking time.
    I am therefore going to be a little time before I can upload the altered database to a public place.
    Kind regards
    David

  11. #11
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    Try as I might I cannot make the sample database even beging to work as it should, and so I am reluctantly going to have to thank you for your help so far and live with the minor irritations in my original database.
    Thank you very much.

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    I took a look at that site. It says the purchased product can be edited. Unfortunately, the demo version I downloaded cannot. We could attempt to edit your original if you provided description of what you want to modify, post code for analysis. Did you try to get assistance from the developer? If you upload the fiile(s) to fileshare site as ShareAll, you could send me the link(s) in a personal message. Once I download you can remove the upload. Otherwise, keep learning and you will eventually figure it out.
    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.

  13. #13
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    I have tried on a previous occasion to get assistance from the developer, but all he does is suggest I employ a database expert. I am treasurer of a very small charity, and this database is exclusively for the use of that charity, and we do not have the funds to pay for professional assistance.
    To open the database in editable mode, hold down the shift key whilst you open it.
    I have put the database, greatly cut down and sanitised, in a public folder at (now deleted)
    I hope you can access it, if not please let me know and I will try box.net. This is the box.net link: Someone has downloaded the file and I hope it was you. It isnow deleted.
    If you can access it, please move it from there, or let me know when you have accessed it so I can delete it from the public folder.
    Many thanks
    David

  14. #14
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,928
    DropBox was requiring I create an account and login so I downloaded from the box.net location. You can edit the post to remove links as well as remove from the fileshare sites.

    I know the shift key technique but would not work on the demo version because it is published as an mde file.

    So this is an extract of the purchased project? What specific mods do you need?
    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.

  15. #15
    wdrspens is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    35
    This is an extract from the purchased project.
    In order to make a new booking I have to click on an empty slot in the Appointments screen. Up comes the Make Appointment Screen and I make the necessary entries - I will be changing the label "To See" to "Room" and have to click in the Rate dropdown field to ensure the correct rate is used, and after clicking in the duration field the Charge is calculated. I then, without closing the Make Appointment screen want to be able to click on the "Extras" button to add an extra and have the details of what I have added shown in the Order field at the bottom of the Make Appointment screen and the Total and Balance correctly calculated in the Status area whilst making the entries in the Extras popup form. That would be the ideal solution.
    At the moment that only happens after I have made an initial entry in the Extras popup closed it and the Make Appointment screen, reopened the Make Appointment screen and Extras popup. Then, and only then, at the moment I make alterations in the Extras popup screen do they get correctly reflected in the Make Appointment screen whilst the entries in the extras popup screen are still being entered.
    That would be my ideal solution, although I can live with it as it is at the moment.
    Again your help is greatly appreciated.
    Kind regards
    David

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Popup form
    By triplee23 in forum Forms
    Replies: 1
    Last Post: 10-24-2010, 04:09 PM
  2. Popup Form
    By NISMOJim in forum Forms
    Replies: 1
    Last Post: 10-23-2010, 09:16 AM
  3. popup when opening a form
    By ajetrumpet in forum Forms
    Replies: 1
    Last Post: 10-08-2010, 09:33 AM
  4. Replies: 10
    Last Post: 09-27-2010, 08:06 PM
  5. Form-Subform-Popup Problem
    By TrudyD1474 in forum Forms
    Replies: 1
    Last Post: 06-10-2010, 05:36 PM

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