Option Group - Blank Choice

J

Jani

I have an option group which works correctly to open up several different
forms. The problem is that if I open up FormA, close FormA and am then back
to the main switchboard, I can't again open up FormA immediately; must open
up FormB (or whatever), close FormB, then can open FormA again. What am I not
doing? I've tried requery with no success. Thanks in advance for your help.
Jani
 
K

KARL DEWEY

It is really hard to say without know how you open formA using the options
group.
What is the flow of data/actions are you using?
When you return to the switchboard are you closing formA or just placing
focus on the switchboard?
 
K

KARL DEWEY

First part of my query - How you open formA using the options group. What is
the flow of data/actions are you using?
 
J

Jani

Sorry - following code opens the FormA (or the one chosen):
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
 
L

Linq Adams via AccessMonster.com

This should solve your problem:

Private Sub MainSwitchboard_AfterUpdate()
Dim strFormName As String

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

DoCmd.OpenForm strFormName
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top