Subform Records Selected

  • Thread starter Thread starter G
  • Start date Start date
G

G

Hi, I have a subform that is in datasheet view.

I would like to know how I can tell what records are
selected on the subform in VB so I can perform operations
on them.

Me.ListData_Subform.SelTop doesn't work.

Me.ListData_Subform.CurrentRecord doesn't work either.

Though I can get the primary key of the first record
selected with:

Me.ListData_Subform.Controls(24).Value

But that automatically shrinks a multi-record selection to
a single record.

Any clues?

Thanks in advance!!!

g-
 
The criteria for determining the Record of a sub Form is
as follows. Add The following code to a command button on
your main form: -

Dim TempStr as String
TempStr=Forms![MasterForm]![SubFormIDOnMasterForm].Form!
[Record]
msgbox("Current Record Number is " & tempstr)

Notes: -

MasterForm is the name of the Main Form.
SubFormIDOnMasterForm is the name of the object on the
Main Form that contains the Sub Form.
Record is an identity of a Text Box on the Sub Form.

HTH


Tony C.
 
Thanks for the pointer!!!

I can get the active record, but if a User selects more
than one record I'm at a loss. I'll try using your
grammar to see if .SelTop will work on a subform.

That's the real quandry, finding out what ALL the selected
records are in the subform. :)

Thanks!!!

g-
 
Back
Top