LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pulling data from database

The listbox should have no rowsource assignment

assume the market name is in column A and the remainder of the data to the
right

Private Sub Userform_Initialize()
Dim rng as Range, cell as Range
Dim i as Long
Listbox1.ColumnCount = 8
set rng = Worksheets("Data").Range("A1").CurrentRegion
set rng = rng.offset(1,0).Resize(rng.rows.count,1)
for each cell in rng
if cell.Value = Combobox1.Value then
listbox1.AddItem cell.offset(0,1)
for i = 1 to 7
listbox1.List(listbox1.Listcount-1,i) = cell.offset(0, i + 1).Value
Next
End if
Next

End sub

--
Regards,
Tom Ogilvy


"Jennifer" wrote in message
...
Hey all,
Once again I'm back asking for help.
I have a form were my dad enters data about fruit he is taking to the
farmers market. It then goes to the database. When he returns home I would
like to create a form that allows him to choose from a combo box the

market
he attended would probable need to enter the data as well. Then from his
choice, in a list box the info he entered into the database would come up

for
thatparticular Market and date. It would contain the differant fruit

taken, #
of boxes, price/lb. Looking at this info., he would add any waste, unsold
boxes or change the price/lb.
So, the question. I have no idea how to get the info into the list box.
Example:
He chooses Pico (market) 5-6-05 (date)
In the list box pulling from the database up pops:
ID Fruit Variety Market Boxes Taken Weight
Price/LB. Etc.
4 Grapes Pico 15 10.25
3.0
6 Peaches Pico 10 10.
2.25
12 Cherries Pico 3 8
6.00
etc.

Any ideas? Thank you so much in advance. Is it possible to change the info
in the listbox? Thanks again, Jennifer

--
Though daily learning, I LOVE EXCEL!
Jennifer



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulling data from other wb based on data to populate dropdown list Suzann Excel Discussion (Misc queries) 0 April 23rd 09 04:29 PM
database query not showing foxpro database How I import data mangat New Users to Excel 1 June 24th 07 03:31 PM
Saving worksheet as CSV after pulling data from an external data source Richard Edwards[_3_] Excel Programming 4 February 25th 05 09:08 PM
Pulling data out of a large database Dave Excel Discussion (Misc queries) 4 January 20th 05 03:49 AM
Database Funtions for pulling data Quix Excel Programming 1 June 2nd 04 07:47 PM


All times are GMT +1. The time now is 10:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"