Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle Buttons and Options Groups

Status
Not open for further replies.

Bisbee

Technical User
May 15, 2001
7
US
I am trying to create alpha buttons on a form that will allow me to click on a letter and will be advanced to the first last name with that corresponding letter. My form consists of two tabs: Company Info and Personal Info (the last name will appear on the first tab only). Nothing I seem to do works - I have created a macro for the buttons and also went through the option group wizard. What's my problem?
 
Bisbee,

I found your concept interesting. I created a form with no record source. On the form I put command buttons each with a letter of the alphabet as the caption. I added a subform from the table that has all the names.In the buttons' click event I put...

Private Sub txtA_Click()

Dim strName As String

strName = DFirst("Name", "TableName", "[Name] Like 'A' & '*'")
'above is all one line.

SubformName.SetFocus
Me![SubformName].Form![NameField].SetFocus
DoCmd.FindRecord strName

End Sub

Basically what I am doing is setting a variable (strName) to the first record (DFirst Function) that begins with A (accomplished by the 'A' & '*' part of the DFirst function). Then I set the focus to the subform, then set the focus to the field that has my value, then do a find record for by value that is stored in strName.

Hope this gets you closer or inspires someone else to come up with a better method... B-) ljprodev@yahoo.com
Professional Development
MS Access Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top