A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Unbound option group writing text values...



 
 
Thread Tools Display Modes
  #1  
Old August 12th, 2004, 11:39 AM
Davie P
external usenet poster
 
Posts: n/a
Default Unbound option group writing text values...

Hi,

I have an interesting and extremely annoying problem with my option group!

I have setup an option group with 3 options; “Option 1”, “Option 2” and
“Option 3”. These options are not bound to a field as the field must store
these options in pre-determined text format and not numerical (i.e. 1, 2 or
3). Instead I have hidden the bound field “Signoff” and set the options
depending on the value in this hidden field. I have done this through the
forms ‘On Current’ event:

Private Sub Form_Current()

If Me.SignOff.Value = "Option 1" Then
Me.OptionGroup = 1
ElseIf Me.SignOff.Value = "Option 2" Then
Me.OptionGroup = 2
ElseIf Me.SignOff.Value = "Option 3" Then
Me.OptionGroup = 3
Else
Me.SignOff.Value = ""
Me.OptionGroup = 0
End If

End Sub

In order to set the field to the option selected I have set the option
button ‘On Got Focus’ event:

Private Sub Option62_GotFocus()

Me.OptionGroup = 1
Me.SignOff.Value = "Option 1"

End Sub

This works fine, except when I actually set an option button. When I set the
first record’s option button to “Option 1”, the second option button is
unaffected, however the third record’s option button, which was previously
blank, is now being set to “Option 3” !?!

Please help.

Thanks in advance,
Dave
  #2  
Old August 12th, 2004, 01:54 PM
stefan hoffmann
external usenet poster
 
Posts: n/a
Default Unbound option group writing text values...

hi Davie,

Davie P wrote:
Private Sub Option62_GotFocus()
Me.OptionGroup = 1
Me.SignOff.Value = "Option 1"
End Sub

This works fine, except when I actually set an option button. When I set the
first record’s option button to “Option 1”, the second option button is
unaffected, however the third record’s option button, which was previously
blank, is now being set to “Option 3” !?!


Wrong event, should be OnClick, cause GotFocus is also triggerd by
tabbing through your options.

-- stefan --
  #3  
Old August 12th, 2004, 03:15 PM
Davie P
external usenet poster
 
Posts: n/a
Default Unbound option group writing text values...

Hi Stefan,

I am using Access 97 and the 'OnClick' event is not available for option
buttons. Any further suggestions?

Many thanks,
Dave

"stefan hoffmann" wrote:

hi Davie,

Davie P wrote:
Private Sub Option62_GotFocus()
Me.OptionGroup = 1
Me.SignOff.Value = "Option 1"
End Sub

This works fine, except when I actually set an option button. When I set the
first record’s option button to “Option 1”, the second option button is
unaffected, however the third record’s option button, which was previously
blank, is now being set to “Option 3” !?!


Wrong event, should be OnClick, cause GotFocus is also triggerd by
tabbing through your options.

-- stefan --

  #4  
Old August 12th, 2004, 03:27 PM
stefan hoffmann
external usenet poster
 
Posts: n/a
Default Unbound option group writing text values...

hi Davie,

Davie P wrote:
I am using Access 97 and the 'OnClick' event is not available for option
buttons. Any further suggestions?


KeyPress or KeyUp and MouseUp are available and should be a sufficent
replacement.

-- stefan --
  #5  
Old August 12th, 2004, 03:34 PM
stefan hoffmann
external usenet poster
 
Posts: n/a
Default Unbound option group writing text values...

hi Davie,

i forgot: have you checked the option values of option 1 and 3. Are they
different?

-- stefan --
  #6  
Old August 12th, 2004, 03:49 PM
Davie P
external usenet poster
 
Posts: n/a
Default Unbound option group writing text values...

Hi Stefan,

Yes, they are all unique.

Dave

"stefan hoffmann" wrote:

hi Davie,

i forgot: have you checked the option values of option 1 and 3. Are they
different?

-- stefan --

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Free text option Mike New Users 2 July 8th, 2004 03:40 PM
form fields showing "form text" instead of values Arget New Users 2 June 9th, 2004 12:04 AM
Linking group of Option Boxes to Drop-down list values Bill Winkle Worksheet Functions 0 May 6th, 2004 12:57 AM
Converting Text to numeric values MichaelStarman Worksheet Functions 5 January 29th, 2004 07:56 PM
Adding Option Buttons to a Group Box Sandy Worksheet Functions 1 September 28th, 2003 12:13 AM


All times are GMT +1. The time now is 01:10 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 OfficeFrustration.
The comments are property of their posters.