Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Carry over a value from a list box 1

Status
Not open for further replies.

crisis2007

Technical User
Apr 2, 2007
114
US
I am trying to carry over values from a list box that is on another form. The first column (Bound column) is the RosterNumber and the second column has the date. I have the following code in the OnDirty event of the current form:

txtRosterNumber = Forms!F_MainNorth.List88.Value
txtAttendanceDate = Forms!F_MainNorth.List88.Value.Column(2)

The first value carries over fine. The second, which is a date does not. I am thinking I have two problems - the reference to the value in the second column of the ListBox and the format to pass a date. I am having problems finding a solution.
 
columns are zero based (0,1,2) the second column has an idex of 1. Also you may have to convert the value of the listbox to a date. It may do this on its own and not required.

= cdate(Forms!F_MainNorth.List88.Value.Column(1))
 
Thank you for helping me MajP!
I tried your suggestion. It gives me a 424 error "Object required." I am certain that the control names are correct.
 
sorry did not read carefully. Either use the value or the column property not both

= Forms!F_MainNorth.List88.Value.Column(2)
should be
= Forms!F_MainNorth.List88.Column(2)
 
one more time
Forms!F_MainNorth.List88.Column(1)
 
Thank You! I spent two hours trying to figure this out with no luck. Your suggestion worked though. I really do appreciate it! I wished I asked earlier.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top