assigning a value from a column of a combo

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.
 
J

Jeff Boyce

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top