option button - please help

E

efua20

I have a frame (fraTransaction) with 8 option buttons on a data entry from
(frmLNEX) that is linked to a table. How do i get the option buttons to
actually show text information in the table when the user clicks any one of
them. I unbound the frame and added a textbox (txtTransaction) that is bound
to my table but I keep getting an error "the value you entered isn't valid
for this field". Part of the code i tried is
Private Sub fraTransaction_AfterUpdate()
Select Case Me.fraTransaction
Case 1
Me.txtTransaction = "Appropriately Direct Caller"
Me.txtTransaction.Locked = True
Case 2
Me.txtTransaction = "Line of Business"
Me.txtTransaction.Locked = True

End Select
End Sub

Please let me know what i'm doing wrong. Any help would be very much
appreciated. Thanks.
 
J

Jeff Boyce

Why are you storing text in your table, when you already have an option
button value to store?

Options buttons don't "show text information", they only show which option
was chosen. Translating between an option value and a text table entry
(back/forth/back) is quite complex. Could you use the option button's label
to "show the text"?

"the value ... isn't valid" error message suggests that the table/field you
are trying to store the data in is not of the same type as the data you are
trying to store there.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
K

Klatuu

I am with Jeff on this. I would put the text for each button selection as
the button's caption, make the table field a Long data type, and bind the
option group to the field. For existing records, the value in the field will
cause the corresponding button appear to be depressed.
 

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