I have a form that displays client names and information, with a subform that contains invoices pertaining to that client. The underlying tables are joined on client number.
The list of clients is getting unweildy, so I wish to add 26 buttons, one representing each letter of the alphabet, to either GoTo or Filter for that specific letter. I'd prefer to not have to write a SELECT query for each letter. So far, I have been using variations on the following:
Private Sub GoToH_Click()
DoCmd.OpenForm "Data Entry", , , Left(Me.ClientName, 1) = "H"
End Sub
I have also tried
Private Sub GoToL_Click()
DoCmd.OpenForm "Data Entry", , , Me.ClientName Like "L*"
End Sub
Sometimes the event will filter no Client records at all, and sometimes it will filter away all Clients. Every time, however, it filters away all of the invoice records (in the subform).
I am new to VBA, but I do have extensive (aka "overwhelming") reference material. I have invested several hours in this, and I'm still scratching my head.
Thanks,
--Rob
The list of clients is getting unweildy, so I wish to add 26 buttons, one representing each letter of the alphabet, to either GoTo or Filter for that specific letter. I'd prefer to not have to write a SELECT query for each letter. So far, I have been using variations on the following:
Private Sub GoToH_Click()
DoCmd.OpenForm "Data Entry", , , Left(Me.ClientName, 1) = "H"
End Sub
I have also tried
Private Sub GoToL_Click()
DoCmd.OpenForm "Data Entry", , , Me.ClientName Like "L*"
End Sub
Sometimes the event will filter no Client records at all, and sometimes it will filter away all Clients. Every time, however, it filters away all of the invoice records (in the subform).
I am new to VBA, but I do have extensive (aka "overwhelming") reference material. I have invested several hours in this, and I'm still scratching my head.
Thanks,
--Rob