Hi,
I built a main form, a private variable and a subform. If the user clicks to select from subform, I'll assign that private variable declared in main form to the value of the selected item in subform. The work is listed below
frmTutor ' this is Main Form
Option Compare Database
Option Explicit
Private iTApptID As Long
...
Private Sub Form_Click() ' This is a subform
iTApptID = Forms!frmTutor!sbfApptHistory.Form!ID
However, I got a compile error of variable not defined.
How come?
I built a main form, a private variable and a subform. If the user clicks to select from subform, I'll assign that private variable declared in main form to the value of the selected item in subform. The work is listed below
frmTutor ' this is Main Form
Option Compare Database
Option Explicit
Private iTApptID As Long
...
Private Sub Form_Click() ' This is a subform
iTApptID = Forms!frmTutor!sbfApptHistory.Form!ID
However, I got a compile error of variable not defined.
How come?