Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 45
  1. #16
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    [QUOTE=Bob Fitz;519116]
    Quote Originally Posted by deepaksharma View Post
    I believe that I've answered this in post #11.
    I do not use split forms. If you are adamant about using them, then I am unable to offer any more help. Good luck with your endeavours.
    I will try using the Continuous form following your suggestion.


    Can you suggest the code of close button to close any form open on dashchild form because all my forms will open on dash child form only.
    Thank you.

  2. #17
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Code:
    Can you suggest the code of close button to close any form open on dashchild form because all my forms will open on dash child form only.
    Not if that form is a "Split Form"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #18
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Bob Fitz View Post
    Code:
    Can you suggest the code of close button to close any form open on dashchild form because all my forms will open on dash child form only.
    Not if that form is a "Split Form"
    I request you that leave the split form for now. Apart from this, if any other data entry form is opened on the dash child form, then what will be the coding of its close button.

  4. #19
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Quote Originally Posted by deepaksharma View Post
    I request you that leave the split form for now. Apart from this, if any other data entry form is opened on the dash child form, then what will be the coding of its close button.
    Try:

    DoCmd.Close , ""
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #20
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Bob Fitz View Post
    Try:

    DoCmd.Close , ""
    This code closes the entire dashboard.
    I tried by a code which solved the problem but the problem is that it is mandatory to create a button of this code on the dashboard whereas I want to create such buttons on every form which will be run on the dash child form.
    Therefore this code needs amendment.

    Code:
     Private Sub Command79_Click()
    Me.dashchild.SourceObject = ""
    Me.dashchild.SetFocus
    End Sub

  6. #21
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,514
    Which form had a button that closed the dashboard with: Docmd.Close, " "

    On which form is "Command79"
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #22
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,772
    Do yourself a HUGE favour.
    Start giving your controls meaningful names. :-(

    Command79 is not going to mean much to anyone a few months down the line.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  8. #23
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    2,991
    Be specific with commands:

    DoCmd.Close acForm, "TheNameOfTheFormYouWantToClose"

    This will only close the form you specify.
    Apply it to all the forms you want to close, if they are already closed it won't raise an error.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  9. #24
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,752
    You don't "close" a form that is used as a subform, you simply set the subform container control SourceObject to empty string.

    What do you mean by "does not work"? The listbox SQL I suggested does work for me. Would need to Requery the listbox when navigating records. So in Dashboard Current event - Me.List32.Requery

    Split form does work as a subform.
    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. #25
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by June7 View Post
    You don't "close" a form that is used as a subform, you simply set
    Hello June,
    If it is not possible to close any of the forms on the subforms as per your and bob's instructions, I will make the necessary changes to my dashboard and remove the subforms and adopt the approach of opening each form in a new window as suggested by bob.
    I have tried entering the code suggested by you in every way in the gray offer register but till now I am not getting success. Please check the attached file and tell me what mistake I am doing.
    Thank you.
    Attached Files Attached Files

  11. #26
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Welshgasman View Post
    Do yourself a HUGE favour.
    Start giving your controls meaningful names. :-(

    Command79 is not going to mean much to anyone a few months down the line.
    As I mentioned in Post 20, Command 79 is a close button built into the dashboard.

  12. #27
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Minty View Post
    Be specific with commands:

    DoCmd.Close acForm, "TheNameOfTheFormYouWantToClose"

    This will only close the form you specify.
    Apply it to all the forms you want to close, if they are already closed it won't raise an error.
    I've tried it, it doesn't work. June is right.

  13. #28
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,650
    I'd say that you can't close that which is not open (loaded).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  14. #29
    Minty is online now VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    2,991
    To clarify to the OP what is happening here, A subform is not loaded as a Form in the normal sense of a standard Form.
    It is simply a control on a form.
    This control happens to contain a form, but it can also hold and display a report or a query, so it can't be closed independently on its own.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  15. #30
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,547
    Your attached file does not have a Dashboard just a single Split Form?
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

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

Similar Threads

  1. VBA IF NOT Coding
    By Grant Shea in forum Access
    Replies: 4
    Last Post: 09-12-2016, 02:41 PM
  2. Vb Coding Help
    By GarageConcepts in forum Access
    Replies: 1
    Last Post: 03-10-2016, 05:05 PM
  3. VBA Coding Help please
    By cfobare79 in forum Programming
    Replies: 6
    Last Post: 12-07-2014, 07:54 PM
  4. Need help in VBA coding
    By Kcgp in forum Programming
    Replies: 6
    Last Post: 02-01-2012, 11:22 PM
  5. Bar-Coding
    By texasprincess7 in forum Access
    Replies: 1
    Last Post: 02-12-2009, 10:29 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