multipleintell
Technical User
I must be missing something...
I have a form where teachers verify info about themselves, i.e. building code and extension. This form is "frmVerify". They press an "OK" button on this form which loads a new form based on their grade level. A first grade teacher will open the frmGrade1 and a second grade teacher frmGrade2 and so on. I want that form to open to the TeacherCode of the same teacher in the verify form...the problem is...it doesn't work. How am I flubbing this WhereCondition? Is there a better way of doing this? Should I be doing this in the filter condition instead? Doesn't seem to work either way...it brings all 155 teacher up in frmGrade# anyway.
Here is my code....
Private Sub CommandOK_Click()
Dim strForm As String
strForm = "frmVerify"
Select Case cboGrade
Case Is = "K"
DoCmd.OpenForm "frmGradeK", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "1"
DoCmd.OpenForm "frmGrade1", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "2"
DoCmd.OpenForm "frmGrade2", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "3"
DoCmd.OpenForm "frmGrade3", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "4"
DoCmd.OpenForm "frmGrade4", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "5"
DoCmd.OpenForm "frmGrade5", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
Case Else
MsgBox "Please select a grade"
Exit Sub
End Select
End Sub
I have a form where teachers verify info about themselves, i.e. building code and extension. This form is "frmVerify". They press an "OK" button on this form which loads a new form based on their grade level. A first grade teacher will open the frmGrade1 and a second grade teacher frmGrade2 and so on. I want that form to open to the TeacherCode of the same teacher in the verify form...the problem is...it doesn't work. How am I flubbing this WhereCondition? Is there a better way of doing this? Should I be doing this in the filter condition instead? Doesn't seem to work either way...it brings all 155 teacher up in frmGrade# anyway.
Here is my code....
Private Sub CommandOK_Click()
Dim strForm As String
strForm = "frmVerify"
Select Case cboGrade
Case Is = "K"
DoCmd.OpenForm "frmGradeK", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "1"
DoCmd.OpenForm "frmGrade1", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "2"
DoCmd.OpenForm "frmGrade2", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "3"
DoCmd.OpenForm "frmGrade3", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "4"
DoCmd.OpenForm "frmGrade4", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
DoCmd.Close acForm, strForm
Case Is = "5"
DoCmd.OpenForm "frmGrade5", , , [TeacherCode] = Forms![frmVerify]![TeacherCode_v]
Case Else
MsgBox "Please select a grade"
Exit Sub
End Select
End Sub