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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2007 Split Form

Status
Not open for further replies.

jmgaddis

Programmer
Jan 18, 2004
35
US

Trying to use VBA to make the datasheet portion active.

After clicking a "letter".. say Z on the Split form, VBA runs to find the first record with Z starting as their last name of the Employee... anyway... it finds the first record OK.. but the split form is active... trying to make the Datasheet active for the first record it finds so that they can just start pressing the Page Down Key to start scrolling through all the names that start with "Z".

Thanks for any help/direction provided.

John



Private Sub LetterZ_Click()
FindLetter ("Z")
End Sub


Function FindLetter(strLetter)

Me.EmployeeName.SetFocus

SendKeys "%h,s,%l,e,%n"

SendKeys strLetter

DoCmd.RunCommand acCmdFind
SendKeys "%f"
DoCmd.RunCommand acCmdFind
SendKeys Chr(27)
SendKeys Chr(27)
 
Why are you using SendKeys like that? What is it supposed to be doing for you that you can't do with regular code?


Bob Larson
A2K,A2K3,A2K7,SQL Server 2000/2005,Crystal Reports 10/XI,VB6, WinXP, and Vista
Free Quick Tutorials and Samples:
 

So far just experimenting with the split forms... this work is normally done is Excel... about 3 thousand names, going to convert it to Access eventually, but want to keep it as Excel like as possible that they are used to...

So far just straight editing of the database table, no queries or such to use recordset etc...

But my real issue is how to set the focus to the datasheet after the first record has been found.

Something like: Me.Datasheet.SetFocus then they can just start scrolling down to find the name of choice.

P.S. I also have a dropdown that they can start typing the name of the person and then select the name... trying to add to this so they can mirror their actions in Excel, then they can choose which way they want to seek to find the name.

Thanks,
John


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top