Need Help Subform Data Sheet

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    #1

    Need Help Subform Data Sheet

    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
  • Stephen Lebans

    #2
    Re: Need Help Subform Data Sheet

    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_C lick

    ' SetFocu to the SubForm control
    Me.frmcustomerS ales.SetFocus

    Me.frmcustomerS ales.Form.Contr ols("NameOfyour TextBoxControlH ere").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_C lick:
    MsgBox Err.Description
    Resume Exit_cmdSelect_ Click

    End Sub

    --

    HTH
    Stephen Lebans

    Access Code, Tips and Tricks
    Please respond only to the newsgroups so everyone can benefit.


    "Bob" <smileyBob@hotm ail.com> wrote in message
    news:v92la05ths kfdom1aoq72nvue 7m4keiq6r@4ax.c om...[color=blue]
    > 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[/color]

    Comment

    • Bob

      #3
      Re: Need Help Subform Data Sheet

      On Wed, 19 May 2004 03:59:36 GMT, "Stephen Lebans"
      <ForEmailGotoMy .WebSite.-WWWdotlebansdot com@linvalid.co m> wrote:

      Hi Stephen

      That worked great.
      Spot on.

      Thanks very much

      Smiley Bob

      [color=blue]
      >Unfortunatel y, 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_C lick
      >
      >' SetFocu to the SubForm control
      >Me.frmcustomer Sales.SetFocus
      >
      >Me.frmcustomer Sales.Form.Cont rols("NameOfyou rTextBoxControl Here").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[/color]

      Comment

      Working...