S
Sean
I am using a list box to bring up any record on a form. The If ElseIf
statement is:
Private Sub List100_Click
If Me.List100.Value = 1 Then
DoCmd.ApplyFilter , "[ID] =1"
ElseIf Me.List100.Value = 2 Then
DoCmd.ApplyFilter , "[ID] =2"
ElseIf Me.List100.Value = 3Then
DoCmd.ApplyFilter , "[ID] =3"
etc.
End Sub
There is a limit to the number of records which may be checked.
As the code is repetitive I feel sure it can be looped but I do not know how.
Any help please?
JSFP
statement is:
Private Sub List100_Click
If Me.List100.Value = 1 Then
DoCmd.ApplyFilter , "[ID] =1"
ElseIf Me.List100.Value = 2 Then
DoCmd.ApplyFilter , "[ID] =2"
ElseIf Me.List100.Value = 3Then
DoCmd.ApplyFilter , "[ID] =3"
etc.
End Sub
There is a limit to the number of records which may be checked.
As the code is repetitive I feel sure it can be looped but I do not know how.
Any help please?
JSFP