scamas2008
New member
- Local time
- Today, 08:36
- Joined
- Jun 14, 2019
- Messages
- 1
Hello all, I am fairly new to access, and if it weren't for forums like these, I would have given up on this a long time ago, so thank you in advance!
Here is the situation:
I need to filter a multicolumn list box to show "active" certificates on the date I enter in a textbox in the form. I have tried to use a query for the listbox and a select all event on GotFocus but it does not update to current record, even when using requery. So I am now trying to automatically select relevant records. This is my code, but it does not like my If.... line.
Any suggestions?
Private Sub ApplytoShares_GotFocus()
Dim lngRow As Long
With Me.ApplytoShares
For lngRow = 0 To ApplytoShares.ListCount - 1
If (Me.ApplytoShares.Column(1, lngRow)) < Me.DivPdDate And (Me.ApplytoShares.Column(2, lngRow)) Is Null Or (Me.ApplytoShares.Column(2, lngRow)) < Me.DivPdDate Then
ApplytoShares.Selected(lngRow) = True
End If
Next lngRow
End With
End Sub
Here is the situation:
I need to filter a multicolumn list box to show "active" certificates on the date I enter in a textbox in the form. I have tried to use a query for the listbox and a select all event on GotFocus but it does not update to current record, even when using requery. So I am now trying to automatically select relevant records. This is my code, but it does not like my If.... line.
Any suggestions?
Private Sub ApplytoShares_GotFocus()
Dim lngRow As Long
With Me.ApplytoShares
For lngRow = 0 To ApplytoShares.ListCount - 1
If (Me.ApplytoShares.Column(1, lngRow)) < Me.DivPdDate And (Me.ApplytoShares.Column(2, lngRow)) Is Null Or (Me.ApplytoShares.Column(2, lngRow)) < Me.DivPdDate Then
ApplytoShares.Selected(lngRow) = True
End If
Next lngRow
End With
End Sub