Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reset Option Group Values 1

Status
Not open for further replies.

Delindan

MIS
May 27, 2011
203
US
I'm guessing I've just missed this somewhere in the postings...I don't think this should be hard but having trouble figuring it out. I have a form with an option group used as a menu. After clicking an option another form will come up. Once the user is done with their initial selection and comes back to the original form they can't click on anything unless the form is reinitialized. On the properties of the option group I see an option "after update" which I'm guessing is where you would put something to return the values to the original. Can someone help?

Thanks!
 
Hi, I'm in learning mode so chose an option group to use as a menu based on an example I found. Again, I'm new so bound vs. unbound...I believe I'm using a bound assuming it means only one selection can be made. Here is the code behind:

Option Compare Database

Private Sub Frame0_Click()

Dim cselect

cselect = Frame0

Select Case cselect

Case 1
DoCmd.OpenForm "Head Count"

Case 2
DoCmd.OpenForm "Pending View"

Case 3
DoCmd.OpenForm "Report Menu"

Case 4
DoCmd.OpenForm "Import HR Files"

Case 5
DoCmd.OpenForm "View"


End Select


End Sub
 
I would use the AfterUpdate event
Code:
Option Compare Database
Private Sub Frame0_AfterUpdate()
Dim cselect as Integer
cselect = Me.Frame0
Select Case cselect
  Case 1
    DoCmd.OpenForm "Head Count"
  Case 2
    DoCmd.OpenForm "Pending View"
  Case 3
    DoCmd.OpenForm "Report Menu"
  Case 4
    DoCmd.OpenForm "Import HR Files"
  Case 5
    DoCmd.OpenForm "View"
End Select
End Sub

Duane
Hook'D on Access
MS Access MVP
 
So I tried this. Under the properties of the option group in the "after update" field I have event procedure. I entered the coding...not sure whether it makes a difference if it comes before the subroutine for frame0. Anyway, I didn't get any errors which is good. However, when I click on case 1 it goes to the next form as expected and when I close out of that form I would like to be able to click on case 1 again if I choose however I have to make different selection (case 2 for example) before I can click on my original selection (case 1) again. Hopefully I explained that!
 
You're awesome...thanks! By the way, what do you use for menus?
 
Are command buttons the buttons you drag onto forms?
 
Why is this preferrable for you...is it because the wizard will build it for the most part?
 
I think if you look at any use of option groups in almost any windows application, it will not trigger the opening of a form or report like command buttons typically are used for.

Option groups are generally for selecting options rather than executing something.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top