PC Review


Reply
Thread Tools Rate Thread

Combo box limit not working

 
 
=?Utf-8?B?RFY=?=
Guest
Posts: n/a
 
      28th Feb 2006
I'm having a problem basing a combo box on another. The issue is due to the
fact that the combo boxes are both on a sub form, so the query I've entered
in the row source of ComboBox2 does not work. Does anyone know the syntax
for the query criteria? This is what I have currently:

[Forms]![SubForm1]![LimitField1]

The query looks like this:

SELECT [Table1].[ReturnField1], [Table1].LimitField1 FROM [Table1] WHERE
((([Table1].LimitField1)=[Forms]![Subform1]![LimitField1]));
 
Reply With Quote
 
 
 
 
Al Camp
Guest
Posts: n/a
 
      28th Feb 2006
DV,
To reference a value on a subform...
Forms!frmMainForm!frmSubForm.Form!FieldName
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"DV" <(E-Mail Removed)> wrote in message
news:FF9FC617-A480-4346-9260-(E-Mail Removed)...
> I'm having a problem basing a combo box on another. The issue is due to
> the
> fact that the combo boxes are both on a sub form, so the query I've
> entered
> in the row source of ComboBox2 does not work. Does anyone know the syntax
> for the query criteria? This is what I have currently:
>
> [Forms]![SubForm1]![LimitField1]
>
> The query looks like this:
>
> SELECT [Table1].[ReturnField1], [Table1].LimitField1 FROM [Table1] WHERE
> ((([Table1].LimitField1)=[Forms]![Subform1]![LimitField1]));



 
Reply With Quote
 
=?Utf-8?B?RFY=?=
Guest
Posts: n/a
 
      1st Mar 2006
Al, this is specifically what I entered:

[Forms]![frm Research Database Users]![frm Research Database
Subform.Form]![SYSTEM]

and got the following error - Invalid bracketing of name '[Forms]![frm
Research Database Users]![frm Research Database Subform.Form]![SYSTEM]'

"Al Camp" wrote:

> DV,
> To reference a value on a subform...
> Forms!frmMainForm!frmSubForm.Form!FieldName
> --
> hth
> Al Camp
> Candia Computer Consulting - Candia NH
> http://home.comcast.net/~cccsolutions
>
> "DV" <(E-Mail Removed)> wrote in message
> news:FF9FC617-A480-4346-9260-(E-Mail Removed)...
> > I'm having a problem basing a combo box on another. The issue is due to
> > the
> > fact that the combo boxes are both on a sub form, so the query I've
> > entered
> > in the row source of ComboBox2 does not work. Does anyone know the syntax
> > for the query criteria? This is what I have currently:
> >
> > [Forms]![SubForm1]![LimitField1]
> >
> > The query looks like this:
> >
> > SELECT [Table1].[ReturnField1], [Table1].LimitField1 FROM [Table1] WHERE
> > ((([Table1].LimitField1)=[Forms]![Subform1]![LimitField1]));

>
>
>

 
Reply With Quote
 
George Nicholson
Guest
Posts: n/a
 
      2nd Mar 2006
>[frm Research Database Subform.Form]![SYSTEM]

Assuming [frm Research Database Subform] is the name of the *control*
containing your subform, it should be:
[frm Research Database Subform].Form![SYSTEM]

The following has a lot of syntax examples:
http://www.mvps.org/access/forms/frm0031.htm
"Forms: Refer to Form and Subform properties and controls"

1) "Form" is a property of the control, not part of the control name. Odds
are that this is the cause of the "illegal bracketing" error.
2) You may already know this but it's impossible to say from your post:
You can only reference a subform via the Form property of the control
containing the subform. You can *never* use the name of the subform itself
to establish a reference. Exception: when the subform name happens to be
exactly the same as the name of the container control.

A wizard will give the control the same name as the form if you let it, but
that only confuses things IMHO. I always rename my controls, making the
subform name entirely useless and eliminating any confusion. (and I often
change the subform that a control is displaying depending on what the user
is doing, so whatever name the wizard gave the control would quickly become
inappropriate).


HTH,
-----
George Nicholson

Remove 'Junk' from return address.


"DV" <(E-Mail Removed)> wrote in message
news:E4C42F2E-5CE7-4376-8DB7-(E-Mail Removed)...
> Al, this is specifically what I entered:
>
> [Forms]![frm Research Database Users]![frm Research Database
> Subform.Form]![SYSTEM]
>
> and got the following error - Invalid bracketing of name '[Forms]![frm
> Research Database Users]![frm Research Database Subform.Form]![SYSTEM]'
>
> "Al Camp" wrote:
>
>> DV,
>> To reference a value on a subform...
>> Forms!frmMainForm!frmSubForm.Form!FieldName
>> --
>> hth
>> Al Camp
>> Candia Computer Consulting - Candia NH
>> http://home.comcast.net/~cccsolutions
>>
>> "DV" <(E-Mail Removed)> wrote in message
>> news:FF9FC617-A480-4346-9260-(E-Mail Removed)...
>> > I'm having a problem basing a combo box on another. The issue is due
>> > to
>> > the
>> > fact that the combo boxes are both on a sub form, so the query I've
>> > entered
>> > in the row source of ComboBox2 does not work. Does anyone know the
>> > syntax
>> > for the query criteria? This is what I have currently:
>> >
>> > [Forms]![SubForm1]![LimitField1]
>> >
>> > The query looks like this:
>> >
>> > SELECT [Table1].[ReturnField1], [Table1].LimitField1 FROM [Table1]
>> > WHERE
>> > ((([Table1].LimitField1)=[Forms]![Subform1]![LimitField1]));

>>
>>
>>



 
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
Limit list of combo box based on selection of another combo =?Utf-8?B?U28gQ2FsbCBNZSBDcmF6eQ==?= Microsoft Access Form Coding 2 31st Aug 2007 07:44 PM
Limit content in one combo box based on another combo box selectio =?Utf-8?B?Vml2aWFu?= Microsoft Access Form Coding 1 19th Jul 2006 02:38 AM
Using a Combo Box to limit the entries of another combo box Cire via AccessMonster.com Microsoft Access Form Coding 1 4th May 2006 12:46 PM
How to limit combo box list based on value in another combo box? =?Utf-8?B?UGF0IERvb2xz?= Microsoft Access Form Coding 3 9th May 2005 04:51 AM
Combo box problem 'Limit To List' not working =?Utf-8?B?UnljaGVhbg==?= Microsoft Access Forms 3 7th Mar 2004 09:22 PM


Features
 

Advertising
 

Newsgroups
 


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