ABC Commnad Buttons

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to create command buttons with the alphabet. One button "A", Next
"B" and so on... When I click on A, I want it to go to an Employee with a his
lastname starts with A. But that is it, I don't want to generate a Filter.
Just want to travel to that record faster. But the Form should stays the
same.

Thanks
 
It's most efficient to retrieve only one record at a time, so I would
definitely use a filter. When the A button is clicked, read all the primary
keys for people whose name begins with 'A' into a recordset. You will then
need custom navigation buttons to page through the records.
 
cbayardo said:
I am trying to create command buttons with the alphabet. One button "A", Next
"B" and so on... When I click on A, I want it to go to an Employee with a his
lastname starts with A. But that is it, I don't want to generate a Filter.
Just want to travel to that record faster. But the Form should stays the
same.


Use the button's Click event procedure to navigate to the
disired record. The first record with the letter A could be
found use code like:

Me.Recordset.FindFirst "[last name] Like 'A*' "

Now that you know a way to do what you want, you will start
complaining about how tedious it is to do essentially the
same thing 26 times.

See Lyle's code at http://www.lebans.com/selectalpha.htm
 
Me complain, never! This is exactly what I was looking for.

Cheers!

Marshall Barton said:
cbayardo said:
I am trying to create command buttons with the alphabet. One button "A", Next
"B" and so on... When I click on A, I want it to go to an Employee with a his
lastname starts with A. But that is it, I don't want to generate a Filter.
Just want to travel to that record faster. But the Form should stays the
same.


Use the button's Click event procedure to navigate to the
disired record. The first record with the letter A could be
found use code like:

Me.Recordset.FindFirst "[last name] Like 'A*' "

Now that you know a way to do what you want, you will start
complaining about how tedious it is to do essentially the
same thing 26 times.

See Lyle's code at http://www.lebans.com/selectalpha.htm
 
Back
Top