By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,160 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,160 IT Pros & Developers. It's quick & easy.

Need Help Subform Data Sheet

P: n/a
Bob
Hi Everybody

I have a form and Datasheet Subform

If I select the top of the column ie the title of any one of the
columns, I can manually focus on that vertical column.

My question; is there a way that I can shift the focus to the column
programatically, to all the records in the column, and not just the
1st record which is what I'm doing now.

Thanks
Regards Smiley Bob
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Unfortunately, the only method I know of involves SendKeys. Here is
sample code placed behind a CommandButton on the parent Form:

Private Sub cmdSelect_Click()
On Error GoTo Err_cmdSelect_Click

' SetFocu to the SubForm control
Me.frmcustomerSales.SetFocus

Me.frmcustomerSales.Form.Controls("NameOfyourTextB oxControlHere").SetFoc
us
' Make sure the entire field is highlighted
Sendkeys "{F2}"
' ' Ctl plus SpaceBar will highlight the entire column of the selected
control.
Sendkeys "^{ }"

Exit_cmdSelect_Click:
Exit Sub

Err_cmdSelect_Click:
MsgBox Err.Description
Resume Exit_cmdSelect_Click

End Sub

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Bob" <sm*******@hotmail.com> wrote in message
news:v9********************************@4ax.com...
Hi Everybody

I have a form and Datasheet Subform

If I select the top of the column ie the title of any one of the
columns, I can manually focus on that vertical column.

My question; is there a way that I can shift the focus to the column
programatically, to all the records in the column, and not just the
1st record which is what I'm doing now.

Thanks
Regards Smiley Bob


Nov 12 '05 #2

P: n/a
Bob
On Wed, 19 May 2004 03:59:36 GMT, "Stephen Lebans"
<Fo****************************************@linval id.com> wrote:

Hi Stephen

That worked great.
Spot on.

Thanks very much

Smiley Bob

Unfortunately, the only method I know of involves SendKeys. Here is
sample code placed behind a CommandButton on the parent Form:

Private Sub cmdSelect_Click()
On Error GoTo Err_cmdSelect_Click

' SetFocu to the SubForm control
Me.frmcustomerSales.SetFocus

Me.frmcustomerSales.Form.Controls("NameOfyourText BoxControlHere").SetFoc
us
' Make sure the entire field is highlighted
Sendkeys "{F2}"
' ' Ctl plus SpaceBar will highlight the entire column of the selected
control.
Sendkeys "^{ }"

Exit_cmdSelect_Click:
Exit Sub

Err_cmdSelect_Click:
MsgBox Err.Description
Resume Exit_cmdSelect_Click

End Sub


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.