2
2vao
Hello,
I have a combo called Ldg (number) and textbox called ArrDate, TxtUt,TxBd
Ldg- Row source -querie; N0 of Column: 5; 1st Col set to 0; 5th column dates
(Descending); list row = 2 ; Column Heads No
ArrDate : short date (dd-mm-yy)
I want to assign value to TxtUt and TxtBd based on comparison between Ldg
5th Column and ArrDate. Here is my code
Private Sub ArrDate_AfterUpdate()
Me.Ldg.Requery
Me.Ldg.Value = Me.Ldg.ItemData(0)
If Format(Me![Ldg].Column(4),"mm-dd-yy") > Format(Me![ArrDate],"mm-dd-yy" then
Me.Ldg.Value = Me.Ldg.ItemData(1)
Me.TxtUt.Value = Me.Ldg.Column(2)
Me.TxtBd.Value = Me.Ldg.Column(3)
Else
Me.Ldg.Value = Me.Ldg.ItemData(0)
Me.TxtUt.Value = Me.Ldg.Column(2)
Me.TxtBd.Value = Me.Ldg.Column(3)
End if
End Sub.
My problem is that TxtUt and TxtBd always get the value from ItemData(0).
Kindly help.
Many thanks.
I have a combo called Ldg (number) and textbox called ArrDate, TxtUt,TxBd
Ldg- Row source -querie; N0 of Column: 5; 1st Col set to 0; 5th column dates
(Descending); list row = 2 ; Column Heads No
ArrDate : short date (dd-mm-yy)
I want to assign value to TxtUt and TxtBd based on comparison between Ldg
5th Column and ArrDate. Here is my code
Private Sub ArrDate_AfterUpdate()
Me.Ldg.Requery
Me.Ldg.Value = Me.Ldg.ItemData(0)
If Format(Me![Ldg].Column(4),"mm-dd-yy") > Format(Me![ArrDate],"mm-dd-yy" then
Me.Ldg.Value = Me.Ldg.ItemData(1)
Me.TxtUt.Value = Me.Ldg.Column(2)
Me.TxtBd.Value = Me.Ldg.Column(3)
Else
Me.Ldg.Value = Me.Ldg.ItemData(0)
Me.TxtUt.Value = Me.Ldg.Column(2)
Me.TxtBd.Value = Me.Ldg.Column(3)
End if
End Sub.
My problem is that TxtUt and TxtBd always get the value from ItemData(0).
Kindly help.
Many thanks.