Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 33
  1. #16
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Quote Originally Posted by pbaldy View Post
    If you delete using a button, add a requery of the subform to the code.
    Forms!MainFormName!SubformControlName.Form.Requery should do it;


    where subformcontrolname is the name of the control that contains the subform, not the name of the subform itself.

  2. #17
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    There's the fish. I'll get out of the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #18
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    No need. Sorry if you feel pushed out of the way. If so, it is I that should bow out.
    I just liked your answer and thought I'd get ahead of what I figured that was going to be the inevitable question.

  4. #19
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    Hi guys
    Thanks for the feedback it is very much appreciated. I will try your suggestions at work tomorrow and let you know how I get on. From what was supposed to be a simple database it has grown into a bit of a monster and I am learning more and more each day and with forums like this, the support is fantastic.

  5. #20
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Quote Originally Posted by hinchi1 View Post
    <snip> If VBNo then exit sub. If vbYes then execute the append and delete queries<snip>
    Just curious.... why have append and delete queries???
    So much easier to have a Boolean field, maybe "Archived", to indicate desks that have been vacated.
    Queries would have additional criteria of "Archived = False" if in use or "Archived = True" if desks have been vacated

  6. #21
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    Not sure what you mean by Boolean field. Still finding my way around access so open to any new methods.

  7. #22
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    HI Micron

    Not sure what you mean subformcontrolname is the name of the control that contains the subform, not the name of the subform itself. My subform listed in the Objects tale is called qryPGRDesk1FilterAll subform2, so where do i find it's control name?

  8. #23
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Boolean is True / False. Can also equate to Yes/No, On/Off or 1/0. IIRC, sometimes True is -1 but it's fairly rare (no I'm not thinking of the triple state of a checkbox - at least I don't think so).
    Open the main form in design view. With the property sheet visible, click once on what you think is the subform. A highlight line (orange?) will appear around the subform. Look at the property sheet and see the selection type. It should read subform/subreport and it's name should be showing in the combo. When you selected the subform control from the ribbon and added it to the form, you had to choose a source object to have that object show there when the form opens. Before you did that, what you were looking at on the form (the activated control) is the subform/subreport control. It is part of the chain of objects that you have to refer to when drilling down to anything on or about the form that is contained within it.
    Last edited by Micron; 10-13-2017 at 10:39 AM. Reason: typo

  9. #24
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    Thanks for that tried it but all I see is#deleted# in the controls of the record I selected. It did not refresh the subform or do I need another piece of code for that to happen?

  10. #25
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    That is still what you see if you click Refresh All on the Ribbon?
    You used the syntax from post #16? Post what you tried.

  11. #26
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    The syntax is fine but i did not use the the "Refresh All Button" on the ribbon. I was hoping to do this in the code as i am sure the end user will not use the "Refresh All Button" when the record as been archived. Once i am happy with the database i will be splitting it ready for deployment so will that button be there at the user end?

  12. #27
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I was attempting to discover what the results were from using the built in refresh feature. Maybe I'm involved in too many threads in this forum because I find answers like "the syntax is fine" and responses that lack answers to simple questions to be quite frustrating.

  13. #28
    hinchi1 is offline Competent Performer
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    181
    Ok, the syntax to requery the subform seems to work. However, to refresh the data you need to choose the same option from the combobox. I would like the the requery of the form to be automatic. I am sure I will figure it out. Thanks again

  14. #29
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Look again a posts 14 and 15, I think.

  15. #30
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    So why are you using append and delete queries???

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 06-30-2016, 06:38 PM
  2. Replies: 1
    Last Post: 11-26-2014, 02:30 PM
  3. Replies: 2
    Last Post: 04-15-2014, 01:59 PM
  4. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  5. Replies: 1
    Last Post: 03-27-2012, 04:49 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