Access Problem

Alix

Registered User.
Local time
Today, 22:10
Joined
Feb 3, 2003
Messages
32
Hi guys,
I'm completly newbie in access less than a year working for my A-level project
actually ihave a problem my project is about a virtual United Kingdom Awarding body i have to design a system for the monitoring of its post-examination re-marks

I made all my tables but i have very important problem i created a table called result and i put in All subject refference code and a marks boundaries but i thought the typer (who type marks into the table) has to choose the grades manually but my teacher said the program has to choose the grade Automatic with some visual basic codes! (I mean when the typer typed the marks into the table table somehow check the result and compare it with marks boundaries and output the correct grade)

can someone help me in this case?!
Thanks:)
 
You should point out to you Tutor that storing calculated values isn't recommended in a relational db, whether by vba or sql.
Search here for SelectCase statements there have been numerous examples posted.
 
The SelectCase statements are best, but you can also use the If...Then....ElseIf statements too.

If Me.ExamMark > 80 Then
Grade = "A"
ElseIf Me.ExamMark > 70 Then
Grade = "B"

etc etc etc

Rich's way is best though, I was just pointing out an alternative out of interest.

Col
:cool:
 
Thanks Guys
I havent search the forum about that SelectCase statements yet and i would do it know!
But i think we have to the project ONLY with Visual Basic although we havent studied Visual basic in AS and i have really no idea that why we have to do with something that is not related to us!
Thanks Guys!


@ColinEssex:
Thanks for your If....then...else statements
but i have an access file with different mark bounderies for different subject reference code is it possible for you i upload the file here and you just check it out:) :rolleyes:
 
I searched for SelectCase statements but i just got two topic onw is mine and another is here! which i dont think thats very helpful is it possible for you guys to give me more details about this statement in fact i'm very newbie into this stuff!
Thanks:) and sorry for trouble:rolleyes:
 
Last edited:
Search with just the words

Select Case

Also

use the Access help - it explains it very well.

Col
:cool:
 
Thanks Col

Thanks i'll search it know!
my schools internet connetion is very slow and its annoying :(

[EDIT] Am I correct the select case is about SQL server, does it work with access?!
 
Last edited:
Select Case is an Access function.

Use the Access help and you'll see.


Col
:cool:
 
I just ask my Computing teacher and we cannot use Select Case (actually he wasnt sure i would ask) on our project and we have to use Visual Basic i think i have to use that if...then...else statements can you help me what i have to do?!
 
What pray does your teacher think Select Case is then?

:rolleyes:

Col
 
As he knows Select Case is part of Pascal and he wasnt sure that visual basic has such that statements or not he said if that statement its in vb you can use it unless stick to if...then...else

My project in more details:
I have a table called Subject included different subject reference code and different marks bounderis i will attach it at the end of this post, and i have anothertable with candidate name etc
and a form combination of these two .
i want when i type a marks into the table table just check the subject table and give me the marks.


if there is such that statement in vb i will use Select case
unless i have to use if...then...else
:(

Thats too hard for me :(
 

Attachments

  • marksboundaries.jpg
    marksboundaries.jpg
    17.5 KB · Views: 115
Select Case is more efficient than If Then Else in this case and is easier to construct.
Excuse the flippancy, but is your tutor qualified?
Here's a simple example
Private Function ConvertDigit(ByVal MyDigit)
Select Case Val(MyDigit)
Case 1: ConvertDigit = "One"
Case 2: ConvertDigit = "Two"
Case 3: ConvertDigit = "Three"
Case 4: ConvertDigit = "Four"
Case 5: ConvertDigit = "Five"
Case 6: ConvertDigit = "Six"
Case 7: ConvertDigit = "Seven"
Case 8: ConvertDigit = "Eight"
Case 9: ConvertDigit = "Nine"
Case Else: ConvertDigit = ""
End Select

End Function
 
Last edited:
Actually i dont know he is qualified or not any way!
can you show me this select case statement on my case (i included the subject reference code and marks boundaries on my privous post) becuase you cant believe how newbie am i and i couldnt understand even a bit in this select case you show me!
.
 
Last edited:
In that If---then---else statement how can i introduce a variable to each field?!
for example
If Me.ExamMark > 80 Then
Grade = "A"
ElseIf Me.ExamMark > 70 Then
Grade = "B"

Me.ExamMark is invalid unless some how i intriduce it to my field!:(
 
Hi again
I can you Select Case
But there is a problem in using this method (mybe becuase i dont know this statement very good)
i have different subject code andeach subject code has diiferent mark boundaries so how can i use select case in this case becuase program needs to check the each refernce code as well as mark boundaries.
i tried this:
Code:
Select TextMark.Text
Case 0 To 50
     lblAnnounce.Caption = "Your Grade Suxxx"
Case 50 To 100
    lblAnnounce.Caption = "Good"
End Select

in above example there is just one case but i have about 5 different subject and each subject different mark boundaries
can i use Select Case in this case as well, if yes can you give me an exapmle!
 
Function GetMark(sNum As Integer, sType As String)As String
If sType = "English" Then
Select Case sNum

Case Is = 30
GetMark = Fail
Case Is = 60
GetMark = Average
End Select
End If
If sType = "Maths" Then
Select Case sNum

Case Is = 30
GetMark = Useless
Case Is = 80
GetMark = Fair
End Select
End If


End Function
 
Thanks rich, That was what i needed!
Thanks agian!
:)
 

Users who are viewing this thread

Back
Top Bottom