S
Sandy
On my form "Finalise Jobs" i have (amongst other controls), "Date ready" -
txtDateReady, "Date Required" - txtDateRequired, "WhyDelayed" -
txtWhyDelayed, and a search Combo Box - cboSearch.
The following code is attached to txtDateReady :-
Private Sub txtDateReady_AfterUpdate()
If txtDateReady > Forms![Finalise Jobs].txtDateRequired Then
Me.lblWhyDelayed.Visible = True
Me.txtWhyDelayed.Visible = True
Else
Me.lblWhyDelayed.Visible = False
Me.txtWhyDelayed.Visible = False
End If
End Sub
and the following to the form :-
Private Sub Form_Open(Cancel As Integer)
If txtDateReady > Forms![Finalise Jobs].txtDateRequired Then
Me.lblWhyDelayed.Visible = True
Me.txtWhyDelayed.Visible = True
ElseIf txtDateReady = "" Then
Me.lblWhyDelayed.Visible = False
Me.txtWhyDelayed.Visible = False
Else
Me.lblWhyDelayed.Visible = False
Me.txtWhyDelayed.Visible = False
End If
End Sub
and the following on the combo box :-
Private Sub cboSearch_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[JobID] = " & Str(Nz(Me![cboSearch], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
My question :-
When the value in txtDateReady is typed in as greater than that in
txtDateRequired then the txtWhyDelayed is visible. Fine. However when I
search in cboSearch and the record that is shown is known to have a comment
in txtWhyDelayed it is not visible.
What code placed where would force the txtWhyDelayed to be visible when the
txtDateReady is later than txtDateRequired, in other words when a comment
already exists in txtWhyDelayed.
Hope this makes sense
Sandy
txtDateReady, "Date Required" - txtDateRequired, "WhyDelayed" -
txtWhyDelayed, and a search Combo Box - cboSearch.
The following code is attached to txtDateReady :-
Private Sub txtDateReady_AfterUpdate()
If txtDateReady > Forms![Finalise Jobs].txtDateRequired Then
Me.lblWhyDelayed.Visible = True
Me.txtWhyDelayed.Visible = True
Else
Me.lblWhyDelayed.Visible = False
Me.txtWhyDelayed.Visible = False
End If
End Sub
and the following to the form :-
Private Sub Form_Open(Cancel As Integer)
If txtDateReady > Forms![Finalise Jobs].txtDateRequired Then
Me.lblWhyDelayed.Visible = True
Me.txtWhyDelayed.Visible = True
ElseIf txtDateReady = "" Then
Me.lblWhyDelayed.Visible = False
Me.txtWhyDelayed.Visible = False
Else
Me.lblWhyDelayed.Visible = False
Me.txtWhyDelayed.Visible = False
End If
End Sub
and the following on the combo box :-
Private Sub cboSearch_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[JobID] = " & Str(Nz(Me![cboSearch], 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark
End Sub
My question :-
When the value in txtDateReady is typed in as greater than that in
txtDateRequired then the txtWhyDelayed is visible. Fine. However when I
search in cboSearch and the record that is shown is known to have a comment
in txtWhyDelayed it is not visible.
What code placed where would force the txtWhyDelayed to be visible when the
txtDateReady is later than txtDateRequired, in other words when a comment
already exists in txtWhyDelayed.
Hope this makes sense
Sandy