Results 1 to 6 of 6
  1. #1
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA for Recordselector.Click (XP)

    Hi

    I have a datagrid view subform that you can click on to select records. i want the form to automatically select the whole row (as if you clicked on the record selector) whenever a cell is clicked / moved to.
    Im sure this should be simple in VBA - can anyone help?

    Thanks
    Thanks,

    pmatz

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA for Recordselector.Click (XP)

    Try this:

    Private Sub Form_Current()
    RunCommand acCmdSelectRecord
    End Sub

  3. #3
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Recordselector.Click (XP)

    Hi

    works...ok-ish.. but not as good as when i click the record selector. The vba command sometimes selects the whole line, but sometimes opens up the cell within the selection . any other ideas?
    Thanks,

    pmatz

  4. #4
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Recordselector.Click (XP)

    perhaps using a continous form will help - trying now...
    Thanks,

    pmatz

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: VBA for Recordselector.Click (XP)

    If you don't want users to be able to edit anything, a list box might be a better solution than a datasheet form.

  6. #6
    4 Star Lounger
    Join Date
    Aug 2003
    Location
    Stroud, United Kingdom
    Posts
    548
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA for Recordselector.Click (XP)

    Hi

    yes, was thinking of a list box, but the continous forms with that runcmd is fine.
    Thanks,

    pmatz

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •