option group value is value from field

E

Emma

hi!

I want to create an Option group, with the labels 'Foundation' and 'Higher'.
When 'Foundation' is selected, i want this to place the values from the
'GermanExaminationMarkF' field PLUS the value from the 'GermanCourseworkMark'
field into the 'OverallGrade' field.

However, when the option next to the label 'Higher is selected, i want this
to place the values from the 'GermanExaminationMarkH' field PLUS the value
from the 'GermanCourseworkMark' field into the 'OverallGrade' field.

Any ideas of how to solve this would be much appreciated!

Thank you in advance!
 
G

Graham R Seach

Emma,

Private Sub myOptionGroup_Click()
If myOptionGroup = 1 Then 'Foundation and Higher
Me!OverallGrade = Nz(Me!GermanExaminationMarkF, 0) + _
Nz(Me!GermanCourseworkMark, 0)
Else 'Higher
Me!OverallGrade = Nz(Me!GermanExaminationMarkH, 0) + _
Nz(Me!GermanCourseworkMark, 0)
End If
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
E

Emma

Hi! Thank you very much. Do I bound that code to a field or do I add it to
the visual basic. I got the '#Name?' in the OverallGrade field. I can't get
the code to work(I know it'll be correct though-it looks similar to stuff I
used in Excel last year.) Am I supposed to do anything with the Option group
to make this work?

Thanks,
Emma
 
E

Emma

THANK YOU!
It now works, my fault, i'm not at all experianced with Access coding! I had
to change field names etc!

I'm well amazing that it works!

Thanks, its been a solution i have been looking for for about a month now.
 

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