PC Review


Reply
Thread Tools Rate Thread

Option group auto open - Repost Need Help Soon, Please-thanks!

 
 
Jani
Guest
Posts: n/a
 
      15th Oct 2009
My option group for opening forms works correctly. However, when I open a
form, close the form, and am then back to the page with the option group and
try to reselect the same form, it won't do it. I need to open a different
form, back to the option group page, then can select it. Below is the code
that I have in After Update event. Any help would be much appreciated!
Thanks, Jani

Private Sub MainSwitchboard_AfterUpdate()
Dim strFormName As String

Select Case Me.MainSwitchboard
Case 1
strFormName = "frm_CMMS_NonPMTasks"
Case 2
strFormName = "frm_CMMSPrevMaintTable"
Case 3
strFormName = "frm_CMMS_PMTaskList_AddNew"
Case 4
strFormName = "frm_CMMS_PMTaskList_Maintenance"
Case 5
strFormName = "frm_CMMSMainForm_PMTasks"
Case 6
strFormName = "frm_CMMS_Reports"
End Select

DoCmd.OpenForm strFormName
End Sub

 
Reply With Quote
 
 
 
 
Damon Heron
Guest
Posts: n/a
 
      15th Oct 2009
Add this after the line "DoCmd.OpenForm strFormName"---
me.mainswitchboard.value=0


Damon


"Jani" <(E-Mail Removed)> wrote in message
news:00397B5C-48AF-4C8B-9820-(E-Mail Removed)...
> My option group for opening forms works correctly. However, when I open a
> form, close the form, and am then back to the page with the option group
> and
> try to reselect the same form, it won't do it. I need to open a different
> form, back to the option group page, then can select it. Below is the code
> that I have in After Update event. Any help would be much appreciated!
> Thanks, Jani
>
> Private Sub MainSwitchboard_AfterUpdate()
> Dim strFormName As String
>
> Select Case Me.MainSwitchboard
> Case 1
> strFormName = "frm_CMMS_NonPMTasks"
> Case 2
> strFormName = "frm_CMMSPrevMaintTable"
> Case 3
> strFormName = "frm_CMMS_PMTaskList_AddNew"
> Case 4
> strFormName = "frm_CMMS_PMTaskList_Maintenance"
> Case 5
> strFormName = "frm_CMMSMainForm_PMTasks"
> Case 6
> strFormName = "frm_CMMS_Reports"
> End Select
>
> DoCmd.OpenForm strFormName
> End Sub
>



 
Reply With Quote
 
 
 
 
Carl Rapson
Guest
Posts: n/a
 
      15th Oct 2009
You should use something other than an option group for this, since once an
option is selected it can't be re-selected unless a different option is
selected first (the exact behavior you're seeing). I prefer a menu of command
buttons for opening forms like you're decribing; a command button can be
clicked as many times in a row as you wish.

If you insist on continuing to use an option group for this, you will need
to "clear" the option group after your form is opened by setting its value to
Null:

DoCmd.OpenForm strFormName
MainSwitchboard = Null

Disclaimer: I haven't actually tried setting an option group control to Null
like this, but it seems like it should work. I still recomment the command
button approach.

Carl Rapson

"Jani" wrote:

> My option group for opening forms works correctly. However, when I open a
> form, close the form, and am then back to the page with the option group and
> try to reselect the same form, it won't do it. I need to open a different
> form, back to the option group page, then can select it. Below is the code
> that I have in After Update event. Any help would be much appreciated!
> Thanks, Jani
>
> Private Sub MainSwitchboard_AfterUpdate()
> Dim strFormName As String
>
> Select Case Me.MainSwitchboard
> Case 1
> strFormName = "frm_CMMS_NonPMTasks"
> Case 2
> strFormName = "frm_CMMSPrevMaintTable"
> Case 3
> strFormName = "frm_CMMS_PMTaskList_AddNew"
> Case 4
> strFormName = "frm_CMMS_PMTaskList_Maintenance"
> Case 5
> strFormName = "frm_CMMSMainForm_PMTasks"
> Case 6
> strFormName = "frm_CMMS_Reports"
> End Select
>
> DoCmd.OpenForm strFormName
> End Sub
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help on how to grey out one option button in one group box based on the selection of another option button in another group box George Microsoft Excel Programming 13 11th Mar 2007 03:08 PM
Option Group within another Option Group? =?Utf-8?B?a2xlaXZha2F0?= Microsoft Access Getting Started 1 23rd May 2005 08:57 PM
repost: Set the postscript dirver option TTDownloadFormat ("TrueTypeFont Download Option") arnt witteveen Microsoft Windows 2000 Printing 1 23rd Nov 2004 10:56 PM
repost: Set the postscript dirver option TTDownloadFormat ("TrueTypeFont Download Option") arnt witteveen Windows XP Print / Fax 0 21st Oct 2004 04:29 PM
Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! Help! -$- Windows XP Internet Explorer 2 21st Dec 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 AM.