ABC Commnad Buttons

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
 
G

Guest

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.
 
M

Marshall Barton

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top