Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help!!! Form Controls & DB Query's

Hi Folks,

I have two sheets. The first contains a db query with two parameters which
the user is prompted to input for if they refresh the query. My second sheet
is an auto-refreshing query with three columns; first column contains an
order number. the second column contains an order code, and the third column
contains an order description.

On my first sheet I have placed a list box that gets it's input range from
the third column on sheet two (order description), and it's cell link from
the first column (order number) on sheet two.

My thought is to place a button on sheet one next to the list box that will
take the order number associated with the selected order description from the
list box and use that as the parameter for my query.

If possible I'd like to keep the form elements directly on the first sheet
whithout having to resort to a user form if it is more effecient. I'm not
sure how to code the button to take the value I need from the list box.

I have another file which take it's query parameter directly from specific
cells on a sheet but my problem is making the leap from cell selected values
to list box selected values to be used as my parameters for my query.

Any help is always greatly appreciated.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Help!!! Form Controls & DB Query's

cell link from
the first column (order number) on sheet two.

what does that mean. the LinkedCell property is where the Value property of
the listbox is written. See Excel VBA help on BoundColumn for an
illustration of how you can achieve what I think you want. Where it says
controlsource, on the worksheet, that would be the linkedcell.

--
Regards,
Tom Ogilvy


"Stephen" wrote:

Hi Folks,

I have two sheets. The first contains a db query with two parameters which
the user is prompted to input for if they refresh the query. My second sheet
is an auto-refreshing query with three columns; first column contains an
order number. the second column contains an order code, and the third column
contains an order description.

On my first sheet I have placed a list box that gets it's input range from
the third column on sheet two (order description), and it's cell link from
the first column (order number) on sheet two.

My thought is to place a button on sheet one next to the list box that will
take the order number associated with the selected order description from the
list box and use that as the parameter for my query.

If possible I'd like to keep the form elements directly on the first sheet
whithout having to resort to a user form if it is more effecient. I'm not
sure how to code the button to take the value I need from the list box.

I have another file which take it's query parameter directly from specific
cells on a sheet but my problem is making the leap from cell selected values
to list box selected values to be used as my parameters for my query.

Any help is always greatly appreciated.

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help!!! Form Controls & DB Query's

I read up on the cell link and I think i have a better idea of how that
works. so let me pose this...

i have created a second combo box on my first sheet which gives the value of
my second sheets A column that relates to the first combo boxes C column
value. See below...

A B C
1 a a1
2 b b1
3 c c1
4 d d1

So if my first combo box reads "a1" then my second combo box reads "1". If
I change the velue of my first or second combo box, the other returns the
correct value for it's corresponding range...

If box 1 reads then box 2 reads
d1 4
c1 3
a1 1

conversely

If box 2 reads then box 1 reads
1 a1
2 b1
4 d1

Now my question is how can I get the givenvelu of my second combo box to
populate in a given cell that I can have my query reference for it's
parameter?

"Tom Ogilvy" wrote:

cell link from

the first column (order number) on sheet two.

what does that mean. the LinkedCell property is where the Value property of
the listbox is written. See Excel VBA help on BoundColumn for an
illustration of how you can achieve what I think you want. Where it says
controlsource, on the worksheet, that would be the linkedcell.

--
Regards,
Tom Ogilvy


"Stephen" wrote:

Hi Folks,

I have two sheets. The first contains a db query with two parameters which
the user is prompted to input for if they refresh the query. My second sheet
is an auto-refreshing query with three columns; first column contains an
order number. the second column contains an order code, and the third column
contains an order description.

On my first sheet I have placed a list box that gets it's input range from
the third column on sheet two (order description), and it's cell link from
the first column (order number) on sheet two.

My thought is to place a button on sheet one next to the list box that will
take the order number associated with the selected order description from the
list box and use that as the parameter for my query.

If possible I'd like to keep the form elements directly on the first sheet
whithout having to resort to a user form if it is more effecient. I'm not
sure how to code the button to take the value I need from the list box.

I have another file which take it's query parameter directly from specific
cells on a sheet but my problem is making the leap from cell selected values
to list box selected values to be used as my parameters for my query.

Any help is always greatly appreciated.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Help!!! Form Controls & DB Query's

By linking it to the cell where you want the output using the LinkedCell
property.

--
Regards,
Tom Ogilvy

"Stephen" wrote in message
...
I read up on the cell link and I think i have a better idea of how that
works. so let me pose this...

i have created a second combo box on my first sheet which gives the value
of
my second sheets A column that relates to the first combo boxes C column
value. See below...

A B C
1 a a1
2 b b1
3 c c1
4 d d1

So if my first combo box reads "a1" then my second combo box reads "1".
If
I change the velue of my first or second combo box, the other returns the
correct value for it's corresponding range...

If box 1 reads then box 2 reads
d1 4
c1 3
a1 1

conversely

If box 2 reads then box 1 reads
1 a1
2 b1
4 d1

Now my question is how can I get the givenvelu of my second combo box to
populate in a given cell that I can have my query reference for it's
parameter?

"Tom Ogilvy" wrote:

cell link from

the first column (order number) on sheet two.

what does that mean. the LinkedCell property is where the Value property
of
the listbox is written. See Excel VBA help on BoundColumn for an
illustration of how you can achieve what I think you want. Where it
says
controlsource, on the worksheet, that would be the linkedcell.

--
Regards,
Tom Ogilvy


"Stephen" wrote:

Hi Folks,

I have two sheets. The first contains a db query with two parameters
which
the user is prompted to input for if they refresh the query. My second
sheet
is an auto-refreshing query with three columns; first column contains
an
order number. the second column contains an order code, and the third
column
contains an order description.

On my first sheet I have placed a list box that gets it's input range
from
the third column on sheet two (order description), and it's cell link
from
the first column (order number) on sheet two.

My thought is to place a button on sheet one next to the list box that
will
take the order number associated with the selected order description
from the
list box and use that as the parameter for my query.

If possible I'd like to keep the form elements directly on the first
sheet
whithout having to resort to a user form if it is more effecient. I'm
not
sure how to code the button to take the value I need from the list box.

I have another file which take it's query parameter directly from
specific
cells on a sheet but my problem is making the leap from cell selected
values
to list box selected values to be used as my parameters for my query.

Any help is always greatly appreciated.

Thanks!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 83
Default Help!!! Form Controls & DB Query's

got it!!!

I figured out how to properly use the linked cell and =index formula to
return the value that I am looking for from my 'A' column into a cell that is
hidden behind my combo box.

In the final result, I only needed the single combo box that populates it's
values from my 'C' column. With the linked cell and =index I am getting my
proper value into a cell that i am referencing in my query when my users hit
the refresh button. Everything tested out great.

Thank you for all your help and pointing my in the right direction.

"Tom Ogilvy" wrote:

By linking it to the cell where you want the output using the LinkedCell
property.

--
Regards,
Tom Ogilvy

"Stephen" wrote in message
...
I read up on the cell link and I think i have a better idea of how that
works. so let me pose this...

i have created a second combo box on my first sheet which gives the value
of
my second sheets A column that relates to the first combo boxes C column
value. See below...

A B C
1 a a1
2 b b1
3 c c1
4 d d1

So if my first combo box reads "a1" then my second combo box reads "1".
If
I change the velue of my first or second combo box, the other returns the
correct value for it's corresponding range...

If box 1 reads then box 2 reads
d1 4
c1 3
a1 1

conversely

If box 2 reads then box 1 reads
1 a1
2 b1
4 d1

Now my question is how can I get the givenvelu of my second combo box to
populate in a given cell that I can have my query reference for it's
parameter?

"Tom Ogilvy" wrote:

cell link from
the first column (order number) on sheet two.

what does that mean. the LinkedCell property is where the Value property
of
the listbox is written. See Excel VBA help on BoundColumn for an
illustration of how you can achieve what I think you want. Where it
says
controlsource, on the worksheet, that would be the linkedcell.

--
Regards,
Tom Ogilvy


"Stephen" wrote:

Hi Folks,

I have two sheets. The first contains a db query with two parameters
which
the user is prompted to input for if they refresh the query. My second
sheet
is an auto-refreshing query with three columns; first column contains
an
order number. the second column contains an order code, and the third
column
contains an order description.

On my first sheet I have placed a list box that gets it's input range
from
the third column on sheet two (order description), and it's cell link
from
the first column (order number) on sheet two.

My thought is to place a button on sheet one next to the list box that
will
take the order number associated with the selected order description
from the
list box and use that as the parameter for my query.

If possible I'd like to keep the form elements directly on the first
sheet
whithout having to resort to a user form if it is more effecient. I'm
not
sure how to code the button to take the value I need from the list box.

I have another file which take it's query parameter directly from
specific
cells on a sheet but my problem is making the leap from cell selected
values
to list box selected values to be used as my parameters for my query.

Any help is always greatly appreciated.

Thanks!




Reply
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
Query's Keowaz Charts and Charting in Excel 0 November 3rd 09 09:54 PM
how do I change a web query's field length? Vybez Excel Programming 0 September 19th 06 12:03 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Form controls Sheldon Excel Programming 2 October 22nd 04 01:20 PM
about more controls of a form EXCEL$B!!(BNEWS Excel Programming 0 October 1st 04 08:59 AM


All times are GMT +1. The time now is 11:30 PM.

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"