I just joined this forum about a week ago and I've had great luck finding examples of what I need in existing threads. This is my first post, and I'm pretty frustrated, so please be gentle...
I have read several of the other threads on cascading combo boxes and they've been very helpful. I'm really close to getting mine to work, just one problem left.
I have a form (frmProjectEntry) with a subform (subfrmTask Create). The subform has two combo boxes which cascade correctly when I open only the subform from the database window. When I open the main form, I get one of those pop ups asking for a field value on my "forms!subfrmTask Create!cbotasksubtype" field (the child combo in the cascade).
I'm sure I'm probably missing something obvious but I just can't see it. I've tried to apply all of the suggestions I've found in other threads:
- My main form, subform and combo boxes are all based on queries
- parent combo (tasktype) has requery of child combo (tasksubtype) on its afterupdate event; subform and main form both have requery of child combo in oncurrent event
- double checked column counts on each combo box - parent has two columns for tasktypeid and tasktype, child has three columns for subtasktypeid, tasksubtype, tasktypeid(FK)
- changed my subform from a datasheet or continuous form to a single form
Here's some of the code:
main form code:
Private Sub Form_Current()
Me.frmTask_Create_Subform.Requery
End Sub
subform code:
Private Sub Actual_Date_AfterUpdate()
If IsNull(Me!ActualDate) Then
Me!TaskCompleted = 0
Else
Me!TaskCompleted = -1
End If
End Sub
Private Sub cboTaskType_AfterUpdate()
Me.cboTaskSubType.Requery
End Sub
Private Sub Form_Current()
Me.cboTaskSubType.Requery
End Sub
Subform Combo boxes:
Tasktype (parent)
Row source
SELECT tblTaskType.TaskTypeID, tblTaskType.TaskType
FROM tblTaskType
ORDER BY tblTaskType.TaskType;
Tasksubtype (child)
Row source
SELECT [tblTaskSubType].[TaskSubTypeID], [tblTaskSubType].[TaskTypeID], [tblTaskSubType].[TaskSubType]
FROM tblTaskSubType
WHERE ((([tblTaskSubType].[TaskTypeID])=[forms]![subfrmTask Create].[cbotasktype]))
ORDER BY [tblTaskSubType].[TaskSubType];
Can anyone see my problem? Thanks bunches!
I have read several of the other threads on cascading combo boxes and they've been very helpful. I'm really close to getting mine to work, just one problem left.
I have a form (frmProjectEntry) with a subform (subfrmTask Create). The subform has two combo boxes which cascade correctly when I open only the subform from the database window. When I open the main form, I get one of those pop ups asking for a field value on my "forms!subfrmTask Create!cbotasksubtype" field (the child combo in the cascade).
I'm sure I'm probably missing something obvious but I just can't see it. I've tried to apply all of the suggestions I've found in other threads:
- My main form, subform and combo boxes are all based on queries
- parent combo (tasktype) has requery of child combo (tasksubtype) on its afterupdate event; subform and main form both have requery of child combo in oncurrent event
- double checked column counts on each combo box - parent has two columns for tasktypeid and tasktype, child has three columns for subtasktypeid, tasksubtype, tasktypeid(FK)
- changed my subform from a datasheet or continuous form to a single form
Here's some of the code:
main form code:
Private Sub Form_Current()
Me.frmTask_Create_Subform.Requery
End Sub
subform code:
Private Sub Actual_Date_AfterUpdate()
If IsNull(Me!ActualDate) Then
Me!TaskCompleted = 0
Else
Me!TaskCompleted = -1
End If
End Sub
Private Sub cboTaskType_AfterUpdate()
Me.cboTaskSubType.Requery
End Sub
Private Sub Form_Current()
Me.cboTaskSubType.Requery
End Sub
Subform Combo boxes:
Tasktype (parent)
Row source
SELECT tblTaskType.TaskTypeID, tblTaskType.TaskType
FROM tblTaskType
ORDER BY tblTaskType.TaskType;
Tasksubtype (child)
Row source
SELECT [tblTaskSubType].[TaskSubTypeID], [tblTaskSubType].[TaskTypeID], [tblTaskSubType].[TaskSubType]
FROM tblTaskSubType
WHERE ((([tblTaskSubType].[TaskTypeID])=[forms]![subfrmTask Create].[cbotasktype]))
ORDER BY [tblTaskSubType].[TaskSubType];
Can anyone see my problem? Thanks bunches!