G
Guest
On a Task the subform there is a pull-down (cboTask_WBS_ID). When a user
enters a new task (txtTask_ID), the WBS pull-down should be populated with a
value from the ValidWBS table......this has worked in the past but is not
working now. I have gone into the Entry Form and tried to enter a new task
to already existing tasks. The WBS pull-down is empty. Can anyone shed some
light on this to help out?
Here is the On Current event that is attached to the subform:
Private Sub Form_Current()
On Error Resume Next
Dim lGovtReq_ID As Long
Dim SQLStr As String
If Nz(Me.txtTask_ID, "") <> "" Then
lGovtReq_ID = DLookup("GovtReq_ID", "qryFindGovtReqForWBS", "Task_ID = "
& Me.txtTask_ID)
SQLStr = "SELECT WBS_ID, WBS_Number, WBS_Description FROM ValidWBS WHERE
GovtReq_ID = " & lGovtReq_ID & " ORDER BY WBS_Number"
Me.cboTask_WBS_ID.RowSource = SQLStr
Else
Me.cboTask_WBS_ID.RowSource = ""
End If
If Nz(Me.cboTask_WBS_ID, "") <> "" Then
Me.txtTask_WBSDescription = Me.cboTask_WBS_ID.Column(2)
Else
Me.txtTask_WBSDescription = ""
End If
End Sub
enters a new task (txtTask_ID), the WBS pull-down should be populated with a
value from the ValidWBS table......this has worked in the past but is not
working now. I have gone into the Entry Form and tried to enter a new task
to already existing tasks. The WBS pull-down is empty. Can anyone shed some
light on this to help out?
Here is the On Current event that is attached to the subform:
Private Sub Form_Current()
On Error Resume Next
Dim lGovtReq_ID As Long
Dim SQLStr As String
If Nz(Me.txtTask_ID, "") <> "" Then
lGovtReq_ID = DLookup("GovtReq_ID", "qryFindGovtReqForWBS", "Task_ID = "
& Me.txtTask_ID)
SQLStr = "SELECT WBS_ID, WBS_Number, WBS_Description FROM ValidWBS WHERE
GovtReq_ID = " & lGovtReq_ID & " ORDER BY WBS_Number"
Me.cboTask_WBS_ID.RowSource = SQLStr
Else
Me.cboTask_WBS_ID.RowSource = ""
End If
If Nz(Me.cboTask_WBS_ID, "") <> "" Then
Me.txtTask_WBSDescription = Me.cboTask_WBS_ID.Column(2)
Else
Me.txtTask_WBSDescription = ""
End If
End Sub