accesscaped
Technical User
I am doing an Access database to produce a class schedule. I have a form with a yes/no box called active to select desired courses. When active is checked(true)it needs to be compared to the bound control box period_id which can not be null. If it is null the record does not show up when I query all courses where active = yes. I have tried this code:
Private Sub Form_Close()
Dim InValidFlag As Boolean
Dim Message1 As String
Message1 = "Good"
InValidFlag = [Checkbox] And IsNull([period_id])
If InValidFlag = True Then Message1 = "Bad"
Msgbox (Message1)
End Sub
However, this only displays the message when I close the form and also does not tell the user which record is invalid. I want to check if active is true then period_id is not null if it is null a message pops up saying enter a period_id. I am a novice at Access so any help is greatly appreicated. Thank you in advance.
Allen
Private Sub Form_Close()
Dim InValidFlag As Boolean
Dim Message1 As String
Message1 = "Good"
InValidFlag = [Checkbox] And IsNull([period_id])
If InValidFlag = True Then Message1 = "Bad"
Msgbox (Message1)
End Sub
However, this only displays the message when I close the form and also does not tell the user which record is invalid. I want to check if active is true then period_id is not null if it is null a message pops up saying enter a period_id. I am a novice at Access so any help is greatly appreicated. Thank you in advance.
Allen