If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
assigning a value from a column of a combo
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. |
#2
|
|||
|
|||
assigning a value from a column of a combo
I would add a breakpoint in that procedure so as to be able to step through
it, line by line, and see what it is doing. Regards Jeff Boyce Microsoft Office/Access MVP "2vao" wrote in message ... 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. |
Thread Tools | |
Display Modes | |
|
|