Mark Pelletier
Mark Pelletier

Reputation: 1359

Call subform's (datasheet) Click event?

I've had good success calling subform click events when pointing to a control.

I am currently using datasheet as a subform Forms!mainform!InvList_subform. The on-click event works as expected when clicking the subform's datasheet record selector.

I'd like to also call the datasheets on-click event from another event on another subform (AcctList_subform) but cannot quite get the syntax working.

From the AcctList_subform, I've tried variants like the following without success:

Forms!mainform!InvList_subform.Form.Click
Forms!mainform!InvList_subform.Form_Click
Forms!mainform!InvList_subform.Click
Forms!mainform!InvList_subform.Form.Form_Click

What is the correct form, please?

Upvotes: 1

Views: 751

Answers (1)

Krish
Krish

Reputation: 5917

You must change the sub modifier from private to public if you are going to access it from outside the form. in your case Public Sub Form_Click()

Upvotes: 1

Related Questions