Results 1 to 14 of 14
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Subform refresh

    Probably a common question and I did a search for the answer without much luck..

    Trying to refresh/requery a subform and it isn't working.

    The subform name is subPaymentsClusterList, the suform Form is frmPaymentsClusterList

    the main form is frmPayments

    The field is PaymentReceived1st with some After update code in it already.

    I was hoping to have the subform update after the input was made.

    The field on the subform is from a query that calculates 2 fields on the mainform. (so I'm guessing the .requery is required)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    What is the code? What happens - error message, wrong results, nothing?

    It is odd for a subform to calculate with fields that are on main form. Why are you?

    Want to provide db for analysis? Follow instructions at bottom of my post.
    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
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    What is the code? What happens - error message, wrong results, nothing?

    It is odd for a subform to calculate with fields that are on main form. Why are you?

    Want to provide db for analysis? Follow instructions at bottom of my post.
    I think it is time I did - is there a quick way to purge all table data without having to break table relationships?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    If you have Enforce Referential Integrity and Cascade Delete Related Records checked, delete parent and child records will go with. http://office.microsoft.com/en-us/ac...001173951.aspx

    Do you really need to purge all data? Some records helpful in testing. Just remove confidential (phone, address, cc, ssn).
    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.

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    If you have Enforce Referential Integrity and Cascade Delete Related Records checked, delete parent and child records will go with. http://office.microsoft.com/en-us/ac...001173951.aspx

    Do you really need to purge all data? Some records helpful in testing. Just remove confidential (phone, address, cc, ssn).
    10,000 plus records... boss won't let me send it otherwise.

    oh and lock violations?

  6. #6
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    eh.. I just keep getting into roadblocks trying to purge the data necessary (there is a lot).

    Click image for larger version. 

Name:	Capture.JPG 
Views:	11 
Size:	70.0 KB 
ID:	13380

    These are the related tables to the forms

    Click image for larger version. 

Name:	Capture2.jpg 
Views:	14 
Size:	60.3 KB 
ID:	13381

    This is the form (you helped me with this form earlier and gave me a better vba calc but I want to add some more to it to also update the subform).

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    What is the RecordSource for each form?

    What about lock violations? Not something I've paid much attention to.
    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
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    What is the RecordSource for each form?

    What about lock violations? Not something I've paid much attention to.
    Click image for larger version. 

Name:	Capture.JPG 
Views:	12 
Size:	84.4 KB 
ID:	13382 subform

    Click image for larger version. 

Name:	Capture2.jpg 
Views:	11 
Size:	98.2 KB 
ID:	13383 main form

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    That confuses me. Why would form and subform have same tables (tblSchools, tblTeacher, tblJncTeacher) in their RecordSource? Why a subform to add values from the main form? I don't understand what you are trying to accomplish.
    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
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    That confuses me. Why would form and subform have same tables (tblSchools, tblTeacher, tblJncTeacher) in their RecordSource? Why a subform to add values from the main form? I don't understand what you are trying to accomplish.
    Each teacher or payment is tied to a booking via many to many. When schools go to the same booking they show in the submenu. So if 5 schools book to the same booking I need to show in that submenu if any have made payments. The top school is the school that has just made the payment (albeit I would like to hide that top one since it is the same as the one being currently edited). When you go to put in the payment I would expect that the submenu of that school to update with the new price.

    The company might have 5 or more schools attend or book and cancel any one booking - either in a cluster at one school for a performance or at a theatre (divided between seats in that theatre). Hence I couldn't make multiple bookings for the same performance however I can add multiple schools to the one performance now.

    I though it would be as simple as saying "this submenu" refreshes "after updating the price here". I don't quite understand how to affect submenus depending on what I want it to do.... I thought in VBA Me!SumenuControlorName.SumenuForm.Form!PriceTotal. refreshorrequery would work...? I've tried different combinations too with no affect.

    It's nice to get an answer but to understand it is better (teach a man to fish).

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    If I can't understand can't offer solution. Still not clear what is going on. You talk about submenu but did you mean subform?

    Yes, forms and comboboxes can be requeried with the Requery method. I do it frequently. The syntax depends on where the code is executed.

    Want to provide database? Follow instructions at bottom of my post. Identify objects involved.
    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.

  12. #12
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    If I can't understand can't offer solution. Still not clear what is going on. You talk about submenu but did you mean subform?

    Yes, forms and comboboxes can be requeried with the Requery method. I do it frequently. The syntax depends on where the code is executed.

    Want to provide database? Follow instructions at bottom of my post. Identify objects involved.
    Sorry, morning here - I meant sub form not sub menu.

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,954
    Okay, but my previous post still applies.
    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.

  14. #14
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Okay, but my previous post still applies.
    um. I figured it out

    It was
    Code:
    Me.Form.Refresh
    It refreshes the main form which in turn refreshed the subform.

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

Similar Threads

  1. Need Subform to Refresh
    By lenm in forum Forms
    Replies: 7
    Last Post: 10-11-2012, 01:32 PM
  2. Refresh Requery Subform
    By eww in forum Programming
    Replies: 1
    Last Post: 04-05-2011, 09:19 AM
  3. Replies: 15
    Last Post: 11-09-2010, 04:27 PM
  4. refresh subform
    By asmith in forum Forms
    Replies: 5
    Last Post: 09-27-2010, 10:58 AM
  5. Problems with subform refresh
    By Viggen66 in forum Queries
    Replies: 2
    Last Post: 02-23-2010, 04:07 AM

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