I have a form with a combo filter that selects records by course on a subform. In the subform is a calculated box that shows the number of claims outstanding. I am trying to get a prompt message to show before another course is selected through the combo box on the main form, reminding people that there are outstanding forms to print. Unfortunately it is not working.
The main form name is:[Functional Skills Entry Level Course] and the Subform is:[Functional Skills Entry Level C].
The code I am using is
Any help would be gratefully appreciated.
Thank you :)
The main form name is:[Functional Skills Entry Level Course] and the Subform is:[Functional Skills Entry Level C].
The code I am using is
Code:
Private Sub Course_GotFocus()
Dim Msg, Style, Title, Help, Ctxt, Response, MyString
If Forms![Functional Skills Entry Level Course]![Functional Skills Entry Level C].Form![ClaimCount] > 0 Then
Msg = "Would you like to print the claim form before you select another course? If you don't, the claims for this course will be lost"
Style = vbQuestion + vbYesNo
Title = "Change course?"
Response = MsgBox(Msg, Style, Title, Help, Ctxt)
If Response = vbYes Then
If Forms![Functional Skills Entry Level Course]![Functional Skills Entry Level C].Form![TotalEnglish] > 0 And Forms![Functional Skills Entry Level Course]![Functional Skills Entry Level C].Form![TotalNotEnglish] = 0 Then
stDocName = "Functional Skills Entry Level ENGLISH"
DoCmd.OpenReport stDocName, acPreview
Else
If Forms![Functional Skills Entry Level Course]![Functional Skills Entry Level C].Form![TotalEnglish] > 0 And Forms![Functional Skills Entry Level Course]![Functional Skills Entry Level C].Form![TotalNotEnglish] > 0 Then
stDocName = "Functional Skills Entry Level plus ENGLISH"
DoCmd.OpenReport stDocName, acPreview
Else
stDocName = "Functional Skills Entry Level"
DoCmd.OpenReport stDocName, acPreview
End If
End If
DoCmd.SetWarnings False
stDocName = "Update FS Entry Level Claims"
DoCmd.OpenQuery stDocName, acNormal, acEdit
stDocName = "Update FS Entry Level Claims ENGLISH"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Refresh
End If
Forms![Functional Skills Entry Level Course].Requery
If Response = vbNo Then
stDocName = "Clear Functional Skills Entry Level Claims"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Course.SetFocus
End If
End If
Exit_Course_GotFocus_Click:
Exit Sub
End Sub
Thank you :)