By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,162 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,162 IT Pros & Developers. It's quick & easy.

Help with Combo box menu item

P: n/a
Hi
I am trying to use a unbound combo box on a menu form to open another Form
and filter records according to the combo box selection and failing

miserably!

I am using the following - this opens the form but does not apply the

filter.
Private Sub Cbosearch_AfterUpdate()

If IsNull(Me.Cbosearch) Then

Me.FilterOn = False

Else

Me.Filter = "[partype] = " & Me!Cbosearch

Me.FilterOn = True

DoCmd.OpenForm "frmresistor"

End If

End Sub

How to I get the above to apply the filter and just display the

records I selected.

Any help would be very much appreciated.

Dave
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Midiman69 @hotmail.com>" <midiman69<NOSPAM> wrote in message
news:d4*******************@news.demon.co.uk...
Hi
I am trying to use a unbound combo box on a menu form to open another Form and
filter records according to the combo box selection and failing

miserably!

I am using the following - this opens the form but does not apply the

filter.
Private Sub Cbosearch_AfterUpdate()

If IsNull(Me.Cbosearch) Then

Me.FilterOn = False

Else

Me.Filter = "[partype] = " & Me!Cbosearch

Me.FilterOn = True

DoCmd.OpenForm "frmresistor"

End If

End Sub

How to I get the above to apply the filter and just display the

records I selected.

Any help would be very much appreciated.


Your manipulating the filter of the menu form. That accomplishes nothing for
the form you intend to open. The OpenForm method includes an argument for
applying a filter to the form being opened. That is what you need to use.

DoCmd.OpenForm "frmresistor",,,"[partype] = " & Me!Cbosearch

(double check help for the number of commas)

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
Hi

Many thanks for the reply.

When I use you code DoCmd.OpenForm "frmresistor",,,"[partype] = " &
Me!Cbosearch
a dialogue box "Enter Parameter Value" is displayed. If I enter the
parameter the form opens filtered, if not it just displays the un filtered
form.
If possible, coule you suggest were I am going wrong, and how I can apply
the filter directly from the combo box.
Thanks again

Dave

"Rick Brandt" <ri*********@hotmail.com> wrote in message
news:U%*************@newssvr11.news.prodigy.com...
"Midiman69 @hotmail.com>" <midiman69<NOSPAM> wrote in message
news:d4*******************@news.demon.co.uk...
Hi
I am trying to use a unbound combo box on a menu form to open another
Form and filter records according to the combo box selection and failing

miserably!

I am using the following - this opens the form but does not apply the

filter.
Private Sub Cbosearch_AfterUpdate()

If IsNull(Me.Cbosearch) Then

Me.FilterOn = False

Else

Me.Filter = "[partype] = " & Me!Cbosearch

Me.FilterOn = True

DoCmd.OpenForm "frmresistor"

End If

End Sub

How to I get the above to apply the filter and just display the

records I selected.

Any help would be very much appreciated.


Your manipulating the filter of the menu form. That accomplishes nothing
for the form you intend to open. The OpenForm method includes an argument
for applying a filter to the form being opened. That is what you need to
use.

DoCmd.OpenForm "frmresistor",,,"[partype] = " & Me!Cbosearch

(double check help for the number of commas)

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.