Results 1 to 7 of 7
  1. #1
    SemiAuto40 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    41

    Return to frm_menu NOT

    I have a frm_Menu that I substituted for the Switchboard that I used to have because it seemed most advocated doing it that way to manage security and logons.



    The curious and simple problem now is that after I execute the menu option that opens a form allowing data to be entered, and finish entering the data - that instead of returning to the frm_Menu top menu selection like I tried to do by placing a SetFocus on it -- focus goes over to my navigation pane and opens whatever Access object had been highlighted last. Wonder why my SetFocus is not doing right? This one must have an easy solution.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Not an issue I have encountered. Show code procedure that closes form or provide project for analyais.
    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
    SemiAuto40 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    41
    First of all when I started up the database this morning the return to the frm_Menu went fine like it was suposed to -- THEN I went into Design mode on another form and from then on even though I closed Design mode for that form when I cycled through my record adding form I was returned instead of frm_Menu to the Navigation pane where the last Designed form was highlighted. Therefore instead of cycling back to the menu when I press <Enter> it opens that last designed form in Form mode.


    Below is the Close button for form "frm_REQUIRED_Tests"


    Private Sub Close_Test_Form_btn_Click()
    Dim SampleIDCode As String
    Dim PreQueryForm As String
    Dim strSQL As String

    SampleIDCode = SampleIDCode_txt
    DoCmd.Close acForm, "frm_REQUIRED_Tests"

    PreQueryForm = "frm_PreQuery"
    DoCmd.OpenForm PreQueryForm
    Forms![frm_PreQuery]![StoreSampleIDCode_txt] = SampleIDCode

    'below is append query to fill the results table with proper tests
    DoCmd.OpenQuery ("qry_Method_Components_to_Results")
    DoCmd.Close acForm, "frm_PreQuery", acSaveNo
    DoCmd.Close acQuery, "qry_Method_Components_to_Results", acSaveNo

    ' macro to create the Html file for offsite viewing
    DoCmd.RunMacro "mcr_Export2HtmlFile"

    'Below should return to menu form option #1
    Forms![frm_Menu]![cmd_Samples_Option1].SetFocus

    End Sub

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Have you step debugged? Does the SetFocus line execute? Think this is a situation where I will have to analyse the project directly if you want to provide.
    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
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    Try to make sure all forms in design view are closed before opening any form in run mode because it affects the form properties.

  6. #6
    SemiAuto40 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    41
    I stumbled upon an interesting fact. When I go to frm_SampleLogin in Design mode (which is the form called from the frm_Menu option#1) and <Save> and "X" out of frm_SampleLogin THEN shut Access down and restart that the real issue that I want to fix is fine (because frm_SampleLogin is where the first menu option opens).

    Are you saying that even though I don't have any item showing in Design mode that I still may be? Whatever last item I had in Design mode is the one that it cycles to using my menu. Really... Would Access start up from shutdown in Design mode? Is that why the setfocus does not do what I expect it to do... this Design mode issue?

  7. #7
    goodguy is offline Competent Performer
    Windows Vista Access 2007
    Join Date
    Dec 2010
    Location
    Zanzibar, Tanzania
    Posts
    228
    That is one of the most curious (and as you said, interesting!) observations I have ever heard about - but, these things do happen. The trick is to observe keenly and draw conclusions.

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

Similar Threads

  1. how to return the result?
    By lamkee in forum Access
    Replies: 1
    Last Post: 08-10-2010, 10:50 AM
  2. Specify return value
    By Desstro in forum Queries
    Replies: 2
    Last Post: 06-19-2010, 02:12 AM
  3. How do I return the maximum value
    By kam in forum Queries
    Replies: 2
    Last Post: 03-17-2010, 07:38 AM
  4. Return value of row above
    By marimar1097 in forum Access
    Replies: 7
    Last Post: 10-20-2009, 08:06 AM
  5. I need to return a value for calculation.
    By FestoAccessBuilder in forum Access
    Replies: 1
    Last Post: 02-22-2009, 09:58 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