To put the value of (GermanCourseworkMark+German
FoundationExaminationMarkF)
or Higher(GermanCourseworkMark+GermanExaminationMarkH) i have used code
so
that when foundation or higher from the option group is selected, the
total
of this calculation automatically appears in the 'OverallMark' box.
N.B. Frame108=my option group
Private Sub Frame108_Click()
If Frame108 = 1 Then 'Foundation
Me!OverallMark = Nz(Me!GermanExaminationMarkF, 0) +
Nz(Me!GermanCourseworkMark, 0)
Else 'Higher
Me!OverallMark = Nz(Me!GermanExaminationMarkH, 0) +
Nz(Me!GermanCourseworkMark, 0)
End If
End Sub
sorry, I hope that is slightly clearer. Thank you very much for helping
with
this!
Emma
:
Let me be sure that I'm understanding the terms that you're using.
In the first post, you mentioned that the option group has a value of
1
(Foundation) or 2 (Higher).
You then mention that selecting 'Foundation' in the option group then
puts a
value of 'GermanCourseworkMark' and 'GermanExaminationMarkF' in the
'OverallMark' textbox.
Selecting 'Higher' in the option group then puts a value of
'GermanCourseworkMark' and 'GermanExaminationMarkH' in the
'OverallMark'
textbox.
And your last post says that the 'OverallMark' field, to which the
textbox
is bound, should store the value of the option group.
I am confused about what you actually want to store in the
'OverallMark'
field... is it the value of 1 or 2 from the option group? or the text
strings 'GermanCourseworkMark' and 'GermanExaminationMarkH' or the
text
strings 'GermanCourseworkMark' and 'GermanExaminationMarkF'?
Please provide more details. I apologize that I am not comprehending
the
information that you've posted.
--
Ken Snell
<MS ACCESS MVP>
I wanted the value to be placed inthe 'OverallMark' field if thats
what
you
mean, but if I select the Option Groups control source as
OverallMark
then
it
gets bound and I cannot select an option.
I have one form which doesn't update the OptionGroup between each
record
and
another form which doesn't update the OverallMark between each
record,
so
i'm
about halfway there with it, because both forms must both function
similarly...Sorry if i'm not explaining my forms properly, or I'm
not
answering your questions properly, my knowledge of Microsoft Access
isn't
great, I haven't really been using it for too long.
Emma
:
In order for the Option Group to have a unique value for each
record,
you
need a field in the form's Recordsource (which means you'll need a
field
in
a table that is part of the form's Recordsource) where the option
group's
value can be stored. Do you have such a field in a table?
--
Ken Snell
<MS ACCESS MVP>
The Option group needs to be unique to each record, e.g. record
one
I
could
select Foundation, then on the next record I could select Higher,
third
Record Foundation or higher etc, but what is happening at the
moment, I
select foundation on one record, and that changes every other
record
to
be
foundation, and the same happens if i select higher.
The option group has values Foundation + Higher...these values
have
been
created to do the below functions, using visual basic code.
The 'foundation' option showns the value of
'GermanCourseworkMark'
and 'GermanExaminationMarkF' in the 'OverallMark' box when
selected.
The 'Higher' option showns the value of 'GermanCourseworkMark'
and
'GermanExaminationMarkH' in the 'OverallMark' box when selected.
The Option group has no control source...OverallMark has control
source
of
OverallMark
I think thats everything I've implemented so far to do with this
option
group.
Thank You!
Emma
:
By "Options from the Option group will not update on each
record",
what
do
you mean? Do you mean that the optioni group's "selection" isn't
changing
on
each record? It won't unless there it is bound to a field in
your
form's
record source that contains a value that the option group
recognizes
(1
or
2, in your case).
I had understood from your description that you were using the
Option
group
just to make a selection as to what value of data was to be
written
into
the
OverallMark textbox. My suggestion to remove the field name from
the
option
group's control source was because it appeared it was also bound
to
the
OverallMark field, as is the OverallMark textbox, and the two
controls
cannot hold the same type data in your setup from what I'm
reading.
So, are you storing the option group's value in a field in the
form's
recordsource? or are you using it just to make a selection for
your
form
to
write data into the OverallMark textbox?
--
Ken Snell
<MS ACCESS MVP>
Hi!
I have just tried this again, and it won't work properly,
because
the
Options from the Option group will not update on each record,
they
just
stay
the same on each record. if i select 'higher' on one record,
it
stays
on
that
for each record, although the 'OverallMark' updates as it
should.
Do you have any suggestions?
Thanks,
Emma
:
You're welcome.
--
Ken Snell
<MS ACCESS MVP>
Excellent! Thank you very much!!! I've been trying to solve
this
for
hours!!
Thank you again!
Emma
:
If I'm understanding your setup correctly, the Control
Source
property
for
the option group should be empty. It should not be bound
to
OverallMark.
Also, remove the
=[OverallMark]
from the On Mouse Down property for the option group.
--
Ken Snell
<MS ACCESS MVP>
I have created an option group, with the values
'Foundation'
=1
and
'Higher' =2
The 'foundation' option showns the value of
'GermanCourseworkMark'
and
'GermanExaminationMarkF' in the 'OverallMark' box when
selected
The 'Higher' option showns the value of
'GermanCourseworkMark'
and
'GermanExaminationMarkH' in the 'OverallMark' box when
selected
The 'OverallMark' box control source is set to
OverallMark,
the
Option
Groups Control source likewise.
On OptionGroup properites 'On Mouse Down' set to
=[OverallMark]
The Option group functions correctly, but the option box
for
the
option
chosen is not selected(doesn't have a dot in it!)
although
I
have
clicked
it,
the calculations are performed correctly though.
How do I get the Option to be selected when I click it,
so
it
has
a
dot
in
it?
Thank you - if you require anymore information about my
option
group
to
solve this, then I've give it.
Thank you in advance!
Emma