PC Review


Reply
Thread Tools Rate Thread

Combo Box Query in VBA

 
 
=?Utf-8?B?Qm9ubmll?=
Guest
Posts: n/a
 
      8th Nov 2007
I'm having trouble with the multiple criteria in this code. It isn't
returning the record I know is there.

Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
"FROM parts " & _
"WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
"AND parts.pwidth = '" & Text2.Value & "' " & _
"ORDER BY parts.lheight;"

Can anyone help me?

Thanks in advance,

Bonnie
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T2ZlciBDb2hlbg==?=
Guest
Posts: n/a
 
      8th Nov 2007
Is the field "pwidth" type is numeric?
If so you need to drop the single quote, that you use only for text fields

Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
"FROM parts " & _
" WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
" AND parts.pwidth = " & Text2.Value & " " & _
" ORDER BY parts.lheight;"

--
Good Luck
BS"D


"Bonnie" wrote:

> I'm having trouble with the multiple criteria in this code. It isn't
> returning the record I know is there.
>
> Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> "FROM parts " & _
> "WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> "AND parts.pwidth = '" & Text2.Value & "' " & _
> "ORDER BY parts.lheight;"
>
> Can anyone help me?
>
> Thanks in advance,
>
> Bonnie

 
Reply With Quote
 
=?Utf-8?B?Qm9ubmll?=
Guest
Posts: n/a
 
      8th Nov 2007
Thanks Ofer - you have helped me before also. I appreciate your taking the
time. It is numeric and I'm sure that's it.

Thanks again.

Bonnie

"Ofer Cohen" wrote:

> Is the field "pwidth" type is numeric?
> If so you need to drop the single quote, that you use only for text fields
>
> Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> "FROM parts " & _
> " WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> " AND parts.pwidth = " & Text2.Value & " " & _
> " ORDER BY parts.lheight;"
>
> --
> Good Luck
> BS"D
>
>
> "Bonnie" wrote:
>
> > I'm having trouble with the multiple criteria in this code. It isn't
> > returning the record I know is there.
> >
> > Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> > "FROM parts " & _
> > "WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> > "AND parts.pwidth = '" & Text2.Value & "' " & _
> > "ORDER BY parts.lheight;"
> >
> > Can anyone help me?
> >
> > Thanks in advance,
> >
> > Bonnie

 
Reply With Quote
 
=?Utf-8?B?Qm9ubmll?=
Guest
Posts: n/a
 
      11th Nov 2007
Hi Ofer,

That wasn't the problem, I tried it both ways and get the same behaviour.
Any other ideas?

Thanks,

Bonnie

"Ofer Cohen" wrote:

> Is the field "pwidth" type is numeric?
> If so you need to drop the single quote, that you use only for text fields
>
> Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> "FROM parts " & _
> " WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> " AND parts.pwidth = " & Text2.Value & " " & _
> " ORDER BY parts.lheight;"
>
> --
> Good Luck
> BS"D
>
>
> "Bonnie" wrote:
>
> > I'm having trouble with the multiple criteria in this code. It isn't
> > returning the record I know is there.
> >
> > Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> > "FROM parts " & _
> > "WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> > "AND parts.pwidth = '" & Text2.Value & "' " & _
> > "ORDER BY parts.lheight;"
> >
> > Can anyone help me?
> >
> > Thanks in advance,
> >
> > Bonnie

 
Reply With Quote
 
Bob Quintal
Guest
Posts: n/a
 
      11th Nov 2007
=?Utf-8?B?Qm9ubmll?= <(E-Mail Removed)> wrote in
news:E04D1EB2-919F-4961-A1EC-(E-Mail Removed):

> Hi Ofer,
>
> That wasn't the problem, I tried it both ways and get the same
> behaviour. Any other ideas?
>
> Thanks,
>
> Bonnie


Specify the form on which your controls reside, either by using Me!
or Forms!formname!
" WHERE parts.ItemDesc = '" & Me!descrip.Value & "' " & _
" AND parts.pwidth = " & Me!Text2.Value & " " & _


Q

>
> "Ofer Cohen" wrote:
>
>> Is the field "pwidth" type is numeric?
>> If so you need to drop the single quote, that you use only for
>> text fields
>>
>> Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
>> "FROM parts " & _
>> " WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
>> " AND parts.pwidth = " & Text2.Value & " " & _
>> " ORDER BY parts.lheight;"
>>
>> --
>> Good Luck
>> BS"D
>>
>>
>> "Bonnie" wrote:
>>
>> > I'm having trouble with the multiple criteria in this code. It
>> > isn't returning the record I know is there.
>> >
>> > Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
>> > "FROM parts " & _
>> > "WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
>> > "AND parts.pwidth = '" & Text2.Value & "' " & _
>> > "ORDER BY parts.lheight;"
>> >
>> > Can anyone help me?
>> >
>> > Thanks in advance,
>> >
>> > Bonnie

>




--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
=?Utf-8?B?Qm9ubmll?=
Guest
Posts: n/a
 
      11th Nov 2007
Thanks Bob, I'll play with that but there are two other combo boxes I am
using with the same syntax (one criteria) that are working fine.

Bonnie

"Bob Quintal" wrote:

> =?Utf-8?B?Qm9ubmll?= <(E-Mail Removed)> wrote in
> news:E04D1EB2-919F-4961-A1EC-(E-Mail Removed):
>
> > Hi Ofer,
> >
> > That wasn't the problem, I tried it both ways and get the same
> > behaviour. Any other ideas?
> >
> > Thanks,
> >
> > Bonnie

>
> Specify the form on which your controls reside, either by using Me!
> or Forms!formname!
> " WHERE parts.ItemDesc = '" & Me!descrip.Value & "' " & _
> " AND parts.pwidth = " & Me!Text2.Value & " " & _
>
>
> Q
>
> >
> > "Ofer Cohen" wrote:
> >
> >> Is the field "pwidth" type is numeric?
> >> If so you need to drop the single quote, that you use only for
> >> text fields
> >>
> >> Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> >> "FROM parts " & _
> >> " WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> >> " AND parts.pwidth = " & Text2.Value & " " & _
> >> " ORDER BY parts.lheight;"
> >>
> >> --
> >> Good Luck
> >> BS"D
> >>
> >>
> >> "Bonnie" wrote:
> >>
> >> > I'm having trouble with the multiple criteria in this code. It
> >> > isn't returning the record I know is there.
> >> >
> >> > Me.PWIDTH6.RowSource = "Select distinct parts.lheight " & _
> >> > "FROM parts " & _
> >> > "WHERE parts.ItemDesc = '" & descrip.Value & "' " & _
> >> > "AND parts.pwidth = '" & Text2.Value & "' " & _
> >> > "ORDER BY parts.lheight;"
> >> >
> >> > Can anyone help me?
> >> >
> >> > Thanks in advance,
> >> >
> >> > Bonnie

> >

>
>
>
> --
> Bob Quintal
>
> PA is y I've altered my email address.
>
> --
> Posted via a free Usenet account from http://www.teranews.com
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
combo box selection runs query to sum values in table not gettingparameter from combo box RCGUA Microsoft Access Form Coding 2 23rd Jul 2009 01:32 AM
Need combo box to = certain query based on another combo box selec abrown Microsoft Access 2 16th Jul 2008 05:35 PM
Combo to select form then combo to select field for query buscher75 Microsoft Access Forms 1 23rd May 2008 11:34 AM
Return all records in query-based combo box if query returns no re =?Utf-8?B?Ymlnb21lZ2E3Mw==?= Microsoft Access 1 4th Jul 2007 08:41 AM
how to use a combo box result in a sub form combo box / query =?Utf-8?B?UmFiYmllIFdpbGxpYW1z?= Microsoft Access 3 10th Jul 2006 07:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:49 PM.