S
slowuptake
I have a subform with two combo boxes, in which the value in 2nd combo
(cboTask) is dependent upon value in the 1st (cboProject). The code to
perform this is working perfectly when the subform is run independently.
However, when I pull the subform into the main form, the code is unable to
find the values for cboProject ... placing an "enter parameter value" box
onto the screen and asking for Forms!frmTimeInputSub!cboProject
If I enter a valid parameter fro cbo Project, then the remainder of the code
works correctly, meaning cboTask returns the correctly sorted list.
Below is all the code from the subform. I assumed if I replaced
Me.cboProject.ItemDate(0) with Forms!frmTimeInputSub!cboProject...
in Private Sub Form_Load() with that this would solve the problem.
But it doesn't.
Is it a syntax problem, or is there something that needs be public, or am I
as usual even further off track?
regards,
slowuptake
Code =====>
Option Compare Database
Private Sub chrProject_AfterUpdate()
End Sub
Private Sub cboProject_AfterUpdate()
cboTask = Null
cboTask.Requery
cboTask = Me.cboTask.ItemData(0)
End Sub
Private Sub Form_Current()
cboTask.Requery
End Sub
Private Sub Form_Load()
If IsNull(cboProject) Then
cboProject = Me.cboProject.ItemData(0)
Call cboProject_AfterUpdate
End If
End Sub
(cboTask) is dependent upon value in the 1st (cboProject). The code to
perform this is working perfectly when the subform is run independently.
However, when I pull the subform into the main form, the code is unable to
find the values for cboProject ... placing an "enter parameter value" box
onto the screen and asking for Forms!frmTimeInputSub!cboProject
If I enter a valid parameter fro cbo Project, then the remainder of the code
works correctly, meaning cboTask returns the correctly sorted list.
Below is all the code from the subform. I assumed if I replaced
Me.cboProject.ItemDate(0) with Forms!frmTimeInputSub!cboProject...
in Private Sub Form_Load() with that this would solve the problem.
But it doesn't.
Is it a syntax problem, or is there something that needs be public, or am I
as usual even further off track?
regards,
slowuptake
Code =====>
Option Compare Database
Private Sub chrProject_AfterUpdate()
End Sub
Private Sub cboProject_AfterUpdate()
cboTask = Null
cboTask.Requery
cboTask = Me.cboTask.ItemData(0)
End Sub
Private Sub Form_Current()
cboTask.Requery
End Sub
Private Sub Form_Load()
If IsNull(cboProject) Then
cboProject = Me.cboProject.ItemData(0)
Call cboProject_AfterUpdate
End If
End Sub