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

Subform datasheet selection

P: n/a
Is there a way to perform actions on the selected records of a
datasheet subform? Actually I know it can be done from a pulldown menu
or a toolbar. But how can you create a button on the form that will do
the same thing? My problem is that every time you select something on
the datasheet when you click a button or any control you will lose the
selection. Is there anyway to prevent that? I'd rather create a
button than try to manage toolbar menus. Any help would be
appreciated. Here is the code that works with menu toolbar:

Public Function t1()
Dim i As Long
Dim strSQL As String
Dim loqd As QueryDef

vbSelectHeight =
Forms!wlef_WorkList_Edit!wlef_WorkList_Edit_Sub.Fo rm.SelHeight

If Forms!wlef_WorkList_Edit!wlef_WorkList_Edit_Sub.Fo rm.SelHeight = 0
Then
Exit Function
End if

With
Forms!wlef_WorkList_Edit!wlef_WorkList_Edit_Sub.Fo rm.RecordsetClone
.MoveFirst
.Move
Forms!wlef_WorkList_Edit!wlef_WorkList_Edit_Sub.Fo rm.SelTop - 1
For i = 1 To vbSelectHeight
MsgBox DocNo 'do something for each selected record
.MoveNext
Next i
End With
End Function

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
>Is there anyway to prevent that?

I dont think so.

You're now instead in the business of giving every control on your datasheet
a event proc to trap SelHeight, etc into globals whenever they are exited.

I'd go with spending time managing the toolbars.

My 2 cent.

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.