Syntax issue with calling Form Combo Box value

  • Thread starter Mitchell_Collen via AccessMonster.com
  • Start date
M

Mitchell_Collen via AccessMonster.com

This query is supposed to call a form 'f_test' combo box 'combo2'. However,
I have found that the syntax is used for access sql and not sql server 2000.
(The combo box holds a value that will return in f_test subform a resultset
according to what is selected in the combo box, f_view1 is a query view
created that is returns to the subform records according to Area column).
Please hellp me get the syntax right. If you have any suggestions on books
for reference that would be wonderful. Thanks, Mitchell

PARAMETERS [Forms]![f_test]![Combo2] Text ( 255 );
SELECT f_view1.Area
FROM f_view1
WHERE (f_view1.Area Like [Forms]![f_test]![Combo2])

If anything, maybe I am going about this wrong. I really need a subform to
show record set based on what is active in the combo box. Do you think there
is another way?

-Mitchell
 
J

John W. Vinson

This query is supposed to call a form 'f_test' combo box 'combo2'. However,
I have found that the syntax is used for access sql and not sql server 2000.
(The combo box holds a value that will return in f_test subform a resultset
according to what is selected in the combo box, f_view1 is a query view
created that is returns to the subform records according to Area column).
Please hellp me get the syntax right. If you have any suggestions on books
for reference that would be wonderful. Thanks, Mitchell

PARAMETERS [Forms]![f_test]![Combo2] Text ( 255 );
SELECT f_view1.Area
FROM f_view1
WHERE (f_view1.Area Like [Forms]![f_test]![Combo2])

If anything, maybe I am going about this wrong. I really need a subform to
show record set based on what is active in the combo box. Do you think there
is another way?

-Mitchell

Well, you don't need to use the LIKE operator unless you're using wildcards.

But if you just want the subform to display records matching the selected
value in Combo2, you don't need any query at all. Just base the Subform on
View1, and set the Subform's Child Link Field to Area, and its Master Link
Field to [Combo2] (in brackets).

John W. Vinson [MVP]
 
M

Mitchell_Collen via AccessMonster.com

Thanks John! That was very helpful. It worked first try!

-Mitchell
This query is supposed to call a form 'f_test' combo box 'combo2'. However,
I have found that the syntax is used for access sql and not sql server 2000.
[quoted text clipped - 14 lines]
-Mitchell

Well, you don't need to use the LIKE operator unless you're using wildcards.

But if you just want the subform to display records matching the selected
value in Combo2, you don't need any query at all. Just base the Subform on
View1, and set the Subform's Child Link Field to Area, and its Master Link
Field to [Combo2] (in brackets).

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top