Hi all,
Hope someone can help. I am trying to write some code so that when a user goes into a subform only certain choices in a combo box, in that subform, display depending on whether another field in that subform has been populated.
I searched the forum & found this:
http://www.access-programmers.co.uk/forums/showthread.php?t=208653&highlight=validation
I thought this sounds ideal, however when I put my code in nothing happens:
Private Sub Form_Current()
If Me.ToBeDraftDte = "" Then
Me.cboStatus.RowSource = "Select * From tblStatus WHERE Status = 'To Be Drafted'"
Else
Me.cboStatus.RowSource = "Select * From tblStatus"
End If
End Sub
I thought the only option in the combo box would be "To Be Drafted" but I get all the options. Is it something to do with it being in a subform? Do I need to refresh?
Apologies if this is really simple, I'm only just starting with vba.
Many thanks for any replies.
Hope someone can help. I am trying to write some code so that when a user goes into a subform only certain choices in a combo box, in that subform, display depending on whether another field in that subform has been populated.
I searched the forum & found this:
http://www.access-programmers.co.uk/forums/showthread.php?t=208653&highlight=validation
I thought this sounds ideal, however when I put my code in nothing happens:
Private Sub Form_Current()
If Me.ToBeDraftDte = "" Then
Me.cboStatus.RowSource = "Select * From tblStatus WHERE Status = 'To Be Drafted'"
Else
Me.cboStatus.RowSource = "Select * From tblStatus"
End If
End Sub
I thought the only option in the combo box would be "To Be Drafted" but I get all the options. Is it something to do with it being in a subform? Do I need to refresh?
Apologies if this is really simple, I'm only just starting with vba.
Many thanks for any replies.