Connecting Tech Pros Worldwide Help | Site Map

code to open list box from param query

doncee
Guest
 
Posts: n/a
#1: Feb 15 '06
Not an expert but have a paramater query that would like to open
as a list box on an existing form. I have a button which opens
the query from the form right now but would like to have it open
as a list box insted of the query. Seems like should be pretty
simple but not getting anywhere with it. If you need more info
let me know & will try to post it for you. Thanks
dc
fredg
Guest
 
Posts: n/a
#2: Feb 15 '06

re: code to open list box from param query


On Wed, 15 Feb 2006 08:48:18 -0600, doncee wrote:
[color=blue]
> Not an expert but have a paramater query that would like to open
> as a list box on an existing form. I have a button which opens
> the query from the form right now but would like to have it open
> as a list box insted of the query. Seems like should be pretty
> simple but not getting anywhere with it. If you need more info
> let me know & will try to post it for you. Thanks
> dc[/color]

Set the ListBox Row Source Type property to Table/Query.
Set the ListBox Row Source to the query.
Set the column count to whatever number of columns are wanted.
Set the column widths to whatever is appropriate
Set the Bound Column to whatever is appropriate.

When the form opens, it will prompt for the parameter.
You can re-prompt for a new value while the form is open whenever you
refresh the form, or by code:

Me!ListBoxName.Requery
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
doncee
Guest
 
Posts: n/a
#3: Feb 15 '06

re: code to open list box from param query


fredg <fgutkind@example.invalid> wrote in
news:y0tofxm8eqdp$.snyr9879oz15$.dlg@40tude.net:
[color=blue]
> On Wed, 15 Feb 2006 08:48:18 -0600, doncee wrote:
>[color=green]
>> Not an expert but have a paramater query that would like
>> to open as a list box on an existing form. I have a button
>> which opens the query from the form right now but would
>> like to have it open as a list box insted of the query.
>> Seems like should be pretty simple but not getting
>> anywhere with it. If you need more info let me know & will
>> try to post it for you. Thanks dc[/color]
>
> Set the ListBox Row Source Type property to Table/Query.
> Set the ListBox Row Source to the query.
> Set the column count to whatever number of columns are
> wanted. Set the column widths to whatever is appropriate
> Set the Bound Column to whatever is appropriate.
>
> When the form opens, it will prompt for the parameter.
> You can re-prompt for a new value while the form is open
> whenever you refresh the form, or by code:
>
> Me!ListBoxName.Requery[/color]

Thanks for the reply. I am actually setting the parameter
via a text box on the original form & therefore I am bypassing
the parameter prompt. The command button will open the query
directly from the criteria in the text box but will not open the
list box. I guess I am making some sort of circular
reference but somehow I think it should be do able. Any more
thoughts would be appreciated.
dc
doncee
Guest
 
Posts: n/a
#4: Feb 15 '06

re: code to open list box from param query


fredg <fgutkind@example.invalid> wrote in
news:y0tofxm8eqdp$.snyr9879oz15$.dlg@40tude.net:
[color=blue]
> On Wed, 15 Feb 2006 08:48:18 -0600, doncee wrote:
>[color=green]
>> Not an expert but have a paramater query that would like
>> to open as a list box on an existing form. I have a button
>> which opens the query from the form right now but would
>> like to have it open as a list box insted of the query.
>> Seems like should be pretty simple but not getting
>> anywhere with it. If you need more info let me know & will
>> try to post it for you. Thanks dc[/color]
>
> Set the ListBox Row Source Type property to Table/Query.
> Set the ListBox Row Source to the query.
> Set the column count to whatever number of columns are
> wanted. Set the column widths to whatever is appropriate
> Set the Bound Column to whatever is appropriate.
>
> When the form opens, it will prompt for the parameter.
> You can re-prompt for a new value while the form is open
> whenever you refresh the form, or by code:
>
> Me!ListBoxName.Requery[/color]

Never mind my previous messge the Me!list box name.requery
command appears to have done the trick.....thank you very much
dc
Closed Thread