Need help

history

Egyptian Pharaoh
Local time
Today, 06:10
Joined
Jan 26, 2008
Messages
190
Good Morning freinds,

How I can make to combo box related ????
I mean that I have an Access database for students
example : I want to make the Grade (when I select 1 it gives me automatically "Excellent" in the another combox of Result
Anther thing :
want tocalculate the Grade to be like this :
from 45-54 fail
from 55_65 OK
From 75-85 Good
from 85-95 Very Good
from 95-100 Excellent

Thank you
 
Simple Software Solutions

First of all create a combobox names cboGrade

In the properties section set the record source to Value List

Enter: "Fail","OK","Good","Very Good","Excellent"

from 45-54 fail
from 55_65 OK
From 75-85 Good
from 85-95 Very Good
from 95-100 Excellent


What about 66 to 74:confused:
What happens if I score 85:confused:


You must be carefull to cover all options and not miss anything out.


Next on you form create a textbox called TxtScore

(This is where you will enter the number )

On the AfterUpdate Event of TxtScore

Dim StrGrade As String

Select Case TxtScore

Case < 55:StrGrade = "Fail"
Case < 65:StrGrade = "OK"
Case < 75:StrGrade = "Good"
Case < 85:StrGrade = "Very Good"
Case <=100:StrGrade = "Excellent"
Case Else: Msgbox "Invalid Score! Please enter an score between 0 ad 100",,"Invalid Score"

End Select

Me.CboGrade = StrGrade

:confused:Why do you want to use a combo box if a text field makes the selection for you. If you only want to display the appropriate text then simply use a textbox to show the rating.


The above scales a for brevity only, you will decide the grading structure.

CodeMaster::cool:
 
Thank you very much Mr. D crake

I'm realy appreciated for your help and remarks where I forget to put some grades because I was very tired and sleepy
I have done all what you said but it dosen't work why ??

please waiting your help
 
History,
DCrakes code works fine for me......
It might have to do with your textbox or combobox........
Try a little test...... Make 2 unbound text boxes..... name one "txtScore" make the other "txtResult"
Then on the afterupdate event of "txtScore" insert DCrakes code.....

Code:
Dim StrGrade As String

Select Case txtScore

Case Is < 55: StrGrade = "Fail"
Case Is < 65: StrGrade = "OK"
Case Is < 75: StrGrade = "Good"
Case Is < 85: StrGrade = "Very Good"
Case Is <= 100: StrGrade = "Excellent"
Case Else: MsgBox "Invalid Score! Please enter an score between 0 ad 100", , "Invalid Score"

End Select

Me.txtResult = StrGrade

You should see it work then.
 
Thank's a lot Mr.CEH
it's working very well

Thank's
 
Please Freinds
how to sum the records ?
I mean that in my Students program :
I have records of the subjects ( Math,Science,History,.....etc ), so I want to sum all of them and put the result in "Results" record that shows the grade ( Excellent, very good .. etc ) in "Grade"

Hope to recieve reply from you

Thank you very much
 
Thank you very much Freinds

I've found the answer

see you
 

Users who are viewing this thread

Back
Top Bottom