MS Access: Forms, When selecting option button you get code error.


I have a code issue with the option button on this form “frmTools_Dimensional”. I put in some code that worked before. Only one option button should be able to be checked on each record.

 The way it was prior to making the changes you could select more than one. Now you get error when checking any button.

Can someone please check the code


Measuring-Instruments-5-04-11Rev.mdb
James CoatsComputer Info. Sys. StudentAsked:
Who is Participating?
 
danishaniConnect With a Mentor Commented:
Hi there,

I think you had before an Option Box instead of three seperate checkboxes, however below changes does the trick for you. An Optionbox would be could alternative to use.

Private Sub InUse_AfterUpdate()
Me.Inventory = False
Me.OutOfService = False

End Sub

Private Sub Inventory_AfterUpdate()
Me.InUse = False
Me.OutOfService = False

End Sub

Private Sub OutOfService_AfterUpdate()
Me.InUse = False
Me.Inventory = False

End Sub
0
 
peter57rCommented:
You have the wrong type of control in  use.
You need an Option Group control.  The wizard will guide you through it.

If you only want the user to pick one then you should use Option buttons (radio buttons) not Checkboxes.  That is what users expect.

You store the selection in a single field- you do not have separate fields for each option.
0
 
James CoatsComputer Info. Sys. StudentAuthor Commented:
That worked like a charm!!
0
The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

 
danishaniCommented:
See example with Option Group in attached database; added ToolChoice in your table, see your frmTools_Dimensional.

 Measuring-Instruments-5-04-11Rev.mdb
0
 
James CoatsComputer Info. Sys. StudentAuthor Commented:
danishani,

Thank you again for the extra effort. It's nice to have both examples.
0
 
danishaniCommented:
You are very welcome! Glad to help! :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.