E
excelnut1954
Here's what I have:
The user wants to find a record. He clicks a button to request this,
and enters a PO number. A sub in a standard module is executed that
performs a Find. Then another UserForm comes up showing the record. One
of the textboxes of this UserForm will show the total number of records
found under this PO number. Here's the coding for this:
This code is in UserForm13
'Counter for how many of this PO/PL there are on the list
'This goes in TextBox15
CountPO = Application.CountIf(Range("J:J"), FindPOVal)
TextBox15.Value = CountPO
FindPOVal is a declaration in the standard module, and is a variable in
the Find command.
Public FindPOVal As String
There are Next and Previous buttons on this UserForm, that will allow
the user to view each of the found records, backward, and forward.
Here's what I need:
What I want to add to this UserForm is a textbox that will show which
record of those found that is being viewed at that time.
I already have the total count. I need to attach a number for each
found record.
Example: 4 records are found. The 1st records comes up, and the number
in TextBox15 is 4. The number in this new textbox I want to add will
be 1.
User clicks the Next button. Record 2 will appear, and the new text box
will show the number 2. User clicks Next again, and record 3 appears.
TextBox15 shows 3.
The user clicks the Previous button, and record 2 comes up again.
Textbox15 shows 2.
Any suggestions on how to add this counter for the new textbox?
Also, where would I put the code? In UserForm13? Or in the standard
module where the Find command is?
Thanks,
J.O.
The user wants to find a record. He clicks a button to request this,
and enters a PO number. A sub in a standard module is executed that
performs a Find. Then another UserForm comes up showing the record. One
of the textboxes of this UserForm will show the total number of records
found under this PO number. Here's the coding for this:
This code is in UserForm13
'Counter for how many of this PO/PL there are on the list
'This goes in TextBox15
CountPO = Application.CountIf(Range("J:J"), FindPOVal)
TextBox15.Value = CountPO
FindPOVal is a declaration in the standard module, and is a variable in
the Find command.
Public FindPOVal As String
There are Next and Previous buttons on this UserForm, that will allow
the user to view each of the found records, backward, and forward.
Here's what I need:
What I want to add to this UserForm is a textbox that will show which
record of those found that is being viewed at that time.
I already have the total count. I need to attach a number for each
found record.
Example: 4 records are found. The 1st records comes up, and the number
in TextBox15 is 4. The number in this new textbox I want to add will
be 1.
User clicks the Next button. Record 2 will appear, and the new text box
will show the number 2. User clicks Next again, and record 3 appears.
TextBox15 shows 3.
The user clicks the Previous button, and record 2 comes up again.
Textbox15 shows 2.
Any suggestions on how to add this counter for the new textbox?
Also, where would I put the code? In UserForm13? Or in the standard
module where the Find command is?
Thanks,
J.O.