T
tclarke
I'm trying to open a form from a Combo Box, based on the two
conditions of VenueDetailsID and Withdrawn. The following works fine
for one condition; VenueDetailsID:
Private Sub cboCentreStudentDetails_Click()
If Not IsNull(Me.cboCentreStudentDetails) Then
DoCmd.OpenForm "StudentFrm", acFormDS, , _
"VenueDetailsID=" & Me.cboCentreStudentDetails
Me.Visible = False
End If
End Sub
What I'd like to do is to open the form as above but not display
students who have withdrawn. I I have a Check Box in the StudentFrm
called "cboWithdrawn". I've tried adding a Filter to the DoCmd as
shown below but it has no effect and displays no errors.
Private Sub cboCentreStudentDetails_Click()
If Not IsNull(Me.cboCentreStudentDetails) Then
DoCmd.OpenForm "StudentFrm", acFormDS, "chbxWithdrawn = False", _
"VenueDetailsID=" & Me.cboCentreStudentDetails
Me.Visible = False
End If
End Sub
P.S. I've also tried putting "chbxWithdrawn = False" into the OpenArgs
section of the DoCmd and Me.Withdrawn = Me.OpenArgs in the OnOpen
event in StudentFrm but get a Runtime Error saying "You can't assign a
value to this object", Any suggestions would be much appreciated.
conditions of VenueDetailsID and Withdrawn. The following works fine
for one condition; VenueDetailsID:
Private Sub cboCentreStudentDetails_Click()
If Not IsNull(Me.cboCentreStudentDetails) Then
DoCmd.OpenForm "StudentFrm", acFormDS, , _
"VenueDetailsID=" & Me.cboCentreStudentDetails
Me.Visible = False
End If
End Sub
What I'd like to do is to open the form as above but not display
students who have withdrawn. I I have a Check Box in the StudentFrm
called "cboWithdrawn". I've tried adding a Filter to the DoCmd as
shown below but it has no effect and displays no errors.
Private Sub cboCentreStudentDetails_Click()
If Not IsNull(Me.cboCentreStudentDetails) Then
DoCmd.OpenForm "StudentFrm", acFormDS, "chbxWithdrawn = False", _
"VenueDetailsID=" & Me.cboCentreStudentDetails
Me.Visible = False
End If
End Sub
P.S. I've also tried putting "chbxWithdrawn = False" into the OpenArgs
section of the DoCmd and Me.Withdrawn = Me.OpenArgs in the OnOpen
event in StudentFrm but get a Runtime Error saying "You can't assign a
value to this object", Any suggestions would be much appreciated.