Inhibited fileds for Option Group options

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Please, if someone can help anyway..

I have a form in which an option group of 2 option bottoms was created
For each of the option bottom I have some fields related in such a way that
if I press option 1, those fields related to this option must be able of being filled an
if I press option 2, only those related to this option must be able of being filled
In this situation I didn't set any 'default value', in fact at my logic I set a default number different from the values of the option bottoms- so that no previous set appears on the form for this option group
My idea is that when this form opens it must show these two amount of fields in that way that almost we can not see them- I mean, they must be all inhibited. And only when I select one of the options bottom then the fields related to the option bottom chosen will be ready to be filled
I've tried to set EventProcedure by codes on "click"for the form properties- the problem in this case was I had to click at any empty space of the form to validate the inhibition of these fields- it isn't good for me
I've also tried to set on option group properties for EventProcedure with codes for"enter", "click", but my logic didn't worked

I also need to know how to prevent the option chosen on the previous register be present when I open the form for the rigth next register. The way I have my form now- every time I choose a option in a register on the form, this option appears pre-selected on the next form for the next register.
If someone can help me I'd be grateful
Thank you!
 
-----Alex P. Wrote-----
Please, if someone can help anyway...

I have a form in which an option group of 2 option bottoms was created.
For each of the option bottom I have some fields related in such a way that:
if I press option 1, those fields related to this option
must be able of being filled and
if I press option 2, only those related to this option must be able of being filled.
In this situation I didn't set any 'default value', in
fact at my logic I set a default number different from the
values of the option bottoms- so that no previous set
appears on the form for this option group.
My idea is that when this form opens it must show
these two amount of fields in that way that almost we can
not see them- I mean, they must be all inhibited. And
only when I select one of the options bottom then the
fields related to the option bottom chosen will be ready
to be filled.
I've tried to set EventProcedure by codes on "click"for
the form properties- the problem in this case was I had
to click at any empty space of the form to validate the
inhibition of these fields- it isn't good for me.
I've also tried to set on option group properties for
EventProcedure with codes for"enter", "click", but my
logic didn't worked.
I also need to know how to prevent the option chosen on
the previous register be present when I open the form for
the rigth next register. The way I have my form now-
every time I choose a option in a register on the form,
this option appears pre-selected on the next form for the
next register.
If someone can help me I'd be grateful!
Thank you!
.

Alex,

If I understand your questions...

I made a test table with: optionid number
o1data1 text
o1data2 text
o2data1 text
o2data2 text

Then I created the form off that table. The optionid is
the field to store the option group "FRAME12" data. It
has no default.


1. For the show fields on selecting the option button use
the AFTERUPDATE event. Do something like this. The
syntax may need to be changed depending on your values in
your option group and the name of the frame.

Private Sub Frame12_AfterUpdate()
If Frame12 = 1 Then
o1data1.Visible = True 'to gray them out use .enable
o1data2.Visible = True 'instead of .visible
o2data1.Visible = False
o2data2.Visible = False
ElseIf Frame12 = 2 Then
o1data1.Visible = False
o1data2.Visible = False
o2data1.Visible = True
o2data2.Visible = True
Else
o1data1.Visible = False
o1data2.Visible = False
o2data1.Visible = False
o2data2.Visible = False
End If
End Sub

2. using the ON CURRENT event you can use the same code
and when the form goes to a new record, it will perform
the same tests on loading that record

Private Sub Form_Current()
If Frame12 = 1 Then
o1data1.Visible = True
o1data2.Visible = True
o2data1.Visible = False
o2data2.Visible = False
ElseIf Frame12 = 2 Then
o1data1.Visible = False
o1data2.Visible = False
o2data1.Visible = True
o2data2.Visible = True
Else
o1data1.Visible = False
o1data2.Visible = False
o2data1.Visible = False
o2data2.Visible = False
End If
End Sub

hth

Lee T.
townslr@yaho
 
Hi Lee
Thank you for your explanation, but I still have a problem with item 2(on_current event
I work with Access 97 and my list of event available is

BeforeUpdat
AfterUpdat
Ente
Exi
Clic
DblClic
MouseDow
MouseMov
MouseU

my Acces is not in English, but I found the translation on Help. As you see I do not have On Current event- I think that "BeforeUpdate" has not the same meaning, does it?! Reading Help explanation I concluded that they act in different moments- so it wouldn't be my solution
Is there any other way of doing this?
Thanks!
 
Alex,

Sorry, I should have asked which version you were
working with. I'll try it out in A97 and get back to
you. If you wish you can e-mail me at

(e-mail address removed)

Lee T.
-----Original Message-----
Hi Lee!
Thank you for your explanation, but I still have a
problem with item 2(on_current event)
I work with Access 97 and my list of event available is:

BeforeUpdate
AfterUpdate
Enter
Exit
Click
DblClick
MouseDown
MouseMove
MouseUp

my Acces is not in English, but I found the translation
on Help. As you see I do not have On Current event- I
think that "BeforeUpdate" has not the same meaning, does
it?! Reading Help explanation I concluded that they act
in different moments- so it wouldn't be my solution.
 
Alex,

The ON CURRENT event is for the form, not for a
control. Sorry, I should have explained that. If you are
still having troubles. Please feel free to e-mail me.

(e-mail address removed)

Lee T.

-----Original Message-----
Hi Lee!
Thank you for your explanation, but I still have a
problem with item 2(on_current event)
I work with Access 97 and my list of event available is:

BeforeUpdate
AfterUpdate
Enter
Exit
Click
DblClick
MouseDown
MouseMove
MouseUp

my Acces is not in English, but I found the translation
on Help. As you see I do not have On Current event- I
think that "BeforeUpdate" has not the same meaning, does
it?! Reading Help explanation I concluded that they act
in different moments- so it wouldn't be my solution.
 
Back
Top