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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list box question 1

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
0
0
I have two forms linked by record number.I have five fields on the sub form which is used to populate a list box on the main form. the list box picks up the data but it displays the 5 fields across the listbox instead of down the box
eg xxxx|xxxx|xxxx|xxxx|xxxx
instead of:
xxxx
xxxx
xxxx
xxxx
xxxx
any suggestions?
ancillary to this, the list box is showing all the data in the sub form table instead of only showing the data for the current record. eg five records shows as five rows in the list box, each row having five columns. How do I limit the entry to only show the data for the current record? Hope all this makes sense!
TIA

'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
Set the control's columnCount property to 1 (instead of 5). As to the other problem, check the control's Row Source property and make sure it is dependant on the main form's record number. Also, in the On Current method of the main form make sure that it requeries the listbox so the correct information is displayed.
 
Everthing you have suggested checks out but the list box still shows the fields in columns instead of rows. I think I may be missing something obvious.
If I explain exactly what I am attempting it may help clarify the problem.
I have a main form (customer info) and a sub form (Job log) On the mainform is a control button which brings up the job log form. This form is linked to the mainform by record no.
On the job log form is 5 fields [job1];job[2] etc. these fields contain the ongoing jobs for that customer.
What I want on the main form is a list box that shows job1,job2,... in one column i.e.
job1
job2
job3
job4
job5
clicking on on of the jobs will bring up the status of that job.
But what I am getting is:
job1|job2|job3|job4|job5
any suggestions? TIA


'Life is what happens to you while you are busy making other plans' John W. Lennon 1940-1980
 
So the listbox on the main form is the one causing the problems, right? Is the listbox RowSource Type a Table/Query or Value List? If it is a Table/Query, have you run that query and made sure the results are what you want displayed in the listbox? If it is a Value List, make sure each value is separated by a semi-colon.

If this does not work and you willing to e-mail me the DB to my yahoo account (tyme4help) I should be able to figure it out for you pretty quickly. Otherwise let me know the results and we'll try to solve the problem this way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top