0

My problem is:

Main form has 9 command buttons and continuous subform. Click on some button open other form with text box for entering quantity and two command buttons. When click on the first button I want to use caption of pressed button from main form for query. How to get that button caption?

Thanks.

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
nesomis
  • 29
  • 7

1 Answers1

0

You have just clicked the button, you know the name of the control, so I do not quite see the problem, other than that it all sounds like quite a bad idea.

Private Sub cmdClickMe_Click()
Debug.Print Me.cmdClickMe.Caption
Debug.Print Screen.ActiveControl.Caption
End Sub
Fionnuala
  • 90,370
  • 7
  • 114
  • 152
  • Thanks Remou. Your answer solved my problem. Forms!myFormName.ActiveControl.Caption is exactly what I looking for. – nesomis May 13 '12 at 19:39