K
KARL DEWEY
It asks me for the frame value, and each of those query values.
This either means you do not have the form open and an option selected
OR
You have misspelled the names somewhere along the way.
What do you get when you run this query, selecting option 1 --
SELECT [ProcessorIssue],ProcessorIssueQuery AS Option_148
FROM [ProcessorIssueTable]
WHERE [FORMS]![ReversalCostpoint]![Frame145] = 1;
What do you get when you run this query, selecting option 2 --
Select [PCOIssue], PCOIssueQuery AS Option_150
FROM [PCOIssueTable]
WHERE [Forms]![ReversalCostpoint]![Frame145] = 2;
--
KARL DEWEY
Build a little - Test a little
This either means you do not have the form open and an option selected
OR
You have misspelled the names somewhere along the way.
What do you get when you run this query, selecting option 1 --
SELECT [ProcessorIssue],ProcessorIssueQuery AS Option_148
FROM [ProcessorIssueTable]
WHERE [FORMS]![ReversalCostpoint]![Frame145] = 1;
What do you get when you run this query, selecting option 2 --
Select [PCOIssue], PCOIssueQuery AS Option_150
FROM [PCOIssueTable]
WHERE [Forms]![ReversalCostpoint]![Frame145] = 2;
--
KARL DEWEY
Build a little - Test a little
Pwyd said:SELECT [ProcessorIssue],ProcessorIssueQuery AS Option_148
FROM [ProcessorIssueTable]
WHERE [FORMS]![ReversalCostpoint]![Frame145] = 1
UNION ALL Select [PCOIssue], PCOIssueQuery AS Option_150
FROM [PCOIssueTable]
WHERE [Forms]![ReversalCostpoint]![Frame145] = 2;
It asks me for the frame value, and each of those query values. am i not
referring to the queries properly?
or the frame for that matter?
Pwyd said:Nah. both of the tables these queries are drawing from are using text
fields, with nothing else changed on them. no validation rules or anything
like that. I'm still not clear on why it keeps asking me for the parameter
values for the two i listed earlier.
Pwyd said:It is the source, you're correct. I was confused.
Running the Query with either button clicked gives no results
In datasheet form, the two columns don't have any rows.
:
I think the problem is in your union query.
Here are some rules for a union query --
The datatype of each field must match between the queries - first field
DateTime, second field Number-Long Integer, third field text, etc.
In the query below PCOProcessorIssueUnionQuery will appear as Option_148 in
both outputs.
Select ProcessorIssue, PCOProcessorIssueUnionQuery AS Option_148
From [ProcessorIssueTable]
Where [FORMS]![ReversalCostpoint]![Frame145] = 1
UNION ALL Select [PCOIssue], PCOProcessorIssueUnionQuery AS Option_150
FROM [PCOIssueTable]
WHERE [Forms]![ReversalCostpoint]![Frame145] = 2;
I though PCOProcessorIssueUnionQuery was the name of this query as you said
it was the source for the combo.
Try clicking an option and running the query and seeing the results. Then
click the other option and run it.
--
KARL DEWEY
Build a little - Test a little
:
Karl i think i'm missing something. Where do the two queries that represent
the two groups of different issues get added to the combo box if i'm only
pasting their criteria into the union query?
:
for the combo box's row source i was using the union query.
PCOProcessorIssueUnionQuery
:
I also ask you to post the Row Source of the combo.
Select ProcessorIssue, PCOProcessorIssueUnionQuery AS Option_148
From [ProcessorIssueTable]
Where [FORMS]![ReversalCostpoint]![Frame145] = 1
UNION ALL Select [PCOIssue], PCOProcessorIssueUnionQuery AS Option_150
FROM [PCOIssueTable]
WHERE [Forms]![ReversalCostpoint]![Frame145] = 2;
The criteria should be 1 for first query and 2 for the second.
--
KARL DEWEY
Build a little - Test a little
:
Here's what i've got, i'm sure seeing it will help:
Select ProcessorIssue PCOProcessorIssueUnionQuery AS Option_148
From [ProcessorIssueTable]
Where [FORMS]![ReversalCostpoint]![Frame145] = Option_148
UNION ALL Select [PCOIssue] PCOProcessorIssueUnionQuery AS Option_150
FROM [PCOIssueTable]
WHERE [Forms]![ReversalCostpoint]![Frame145] = Option_150;
:
Open the form in design view and look at the proprities of the combo. Copy
the Row Source and post.
Post the SQL of your query.
--
KARL DEWEY
Build a little - Test a little
:
Karl, the option button union query works just like you said it would, except
for one thing, that is perhaps because of my naivete. The query seems to
function properly, except that when switching between the two buttons,
instead of selecting the records i have for those fields in each of those
tables, which hold the various issues for each of those two options, it
simply displays the numbers "1" and "2" in the combo box, if you flip between
each of the options selected. That leads me to believe that "1" and "2"
before the AS statement should be replaced with something, in order to
reference each of the tables. What is it? Or is my intuition incorrect?
:
Thanks Karl, i'll give it a try in the next few days, and i'll definately
come back here with any issues i come upon. You've been very helpful.
Kind Regards,
Pwyd
:
One option is for Processor issues, the other is for PCO issues.
What I posted will do that for you by way of your queries.
The option group selection number will control wich part of the union query
will pull records. That query is in turn used as source for your combo box.
--
KARL DEWEY
Build a little - Test a little
:
The combo box shows a list of issues associated with the option chosen on the
option group. One option is for Processor issues, the other is for PCO
issues. I would like the combo box to allow selection of an issue that is
related to option chosen-- i'm going to be using the option group in some
data construction, counting the number of total errors, errors caused by
processor, errors caused by PCO, and so on, and i couldn't find an easy way
to count that, without a lot more code. Also, i didn't want to make two
seperate combo boxes, when all of the issues are stored on one table, that
seems silly.
Have any other suggestions besides what i'm trying to construct here?
:
Second part -- Also, in what fashion should the option group be included in
the criteria?
SELECT Field1, Field2, Field3, 1 AS Option_One
FROM Table1
WHERE [Forms]![YourFormName]![Frame1] = Option_One
UNION ALL SELECT Field1, Field2, Field3, 2 AS Option_One
FROM Table2
WHERE [Forms]![YourFormName]![Frame1] = Option_One;
--
KARL DEWEY
Build a little - Test a little
:
I'm not familiar with union queries. Will the wizard guide me through
everything i need to use this? Also, in what fashion should the option group
be included in the criteria?
:
This is one way --
Create your queries and include the option group as criteria. Then combine
the two queries in a union query. Only the query that matches the option
selection will output records.
--
KARL DEWEY
Build a little - Test a little
:
I would like to build an option group with two options, if one option is
selected, a combo box displays one query's results, if the other option is
selected, a different query is populated into the combo box. How would i go
about doing this?