PMFBI
In addition to Klatuu's sage post,
Assuming......
[C ID] is type Long and no value
exists for it that is zero....
[Client Name] and Division are type Text....
the SQL for your combo box could be:
SELECT
[tbl Client Data].[C ID],
[tbl Client Data].[Client Name],
[tbl Client Data].Division
FROM
[tbl Client Data]
UNION
SELECT
0,
"(ALL)",
"(ALL)"
FROM
[tbl Client Data]
ORDER BY
[Client Name];
there is no clue by what field you want to
sort your combo box, but by using 0 and
"(ALL)," it should "rise to the top."
some alternatives for your main query's criteria
1) if bound column of combo box is 2nd column:
WHERE
[forms]![zjunk]![combo3] = "(All)"
OR
[Client Name]=[forms]![zjunk]![combo3]
2) if bound column of combo box is 1st column:
WHERE
[forms]![zjunk]![combo3] = 0
OR
[C ID]=[forms]![zjunk]![combo3]
Kerry Purdy said:
Many thanks for your reply, this option sounds great, much more user
friendly. Applying it tho I have got a little stuck.
Do I add the Union info to the SQL view of the query which works as the
data
for my combo list of clients? or do I add this to the query which will
give
me the client details I am after?
Here is the SQL view of the combo box query
SELECT [tbl Client Data].[C ID], [tbl Client Data].[Client Name], [tbl
Client Data].Division
FROM [tbl Client Data];
Many thanks for your time.
Kerry
:
Here is an example that adds the work (All) to the combo. It is more
descriptive to the user than just an *
SELECT EmployeeNum FROM tbllkEmployee UNION Select "(All)" as Bogus
From
tbllkEmployee UNION Select "(All)" as Bogus From tbllkEmployee;
Now, in your query criteria, you would use something like this:
Like IIf([forms]![zjunk]![combo3]="(All)","*",[forms]![zjunk]![combo3])
:
Hi
I have created a query from form, I am able to use the * wildcard if I
wish
so all is well so far.
What I would like to do is have the * as the default value in the combo
box
so it will show all records unless I choose differently. I have tried
entering an * in the default value of the combo box but it doesn't
return any
records, if i type the * manually it works - what am i missing?
Many thanks
Kerry