"Please Select One..."

nka

Waterwings inflated
Local time
Today, 17:31
Joined
Jul 11, 2005
Messages
16
Hi All,

I am trying to remember how on earth I did this a few years ago - I want to use a combo box to select the current month.

Currently, the recordsource comes from a query, but I would also like to add a field at the end (or beginning) of the query recordset (?)

I vaguely remember that I had to view SQL rather than design view and add some text to include the "false" field entry.

Currently my combo box shows:
January
February
March
... and so on

I would like to see
Please Select a Month
January
February
March ...

Can anyone refresh my mind please?

Many thanks
 
Would something like this work in your SQL query?

SELECT Month FROM tblMonths UNION SELECT "Please Select a Month" FROM tblMonths;

Then you could put "Please Select a Month" as default value for the combo box so it shows up first.

Keep in mind if your table has more than one field, like a numeric primary key, this won't work.
 
Thanks for that! My memory was just starting to come back to me and you came through at the same time!

That's exactly what I am looking for!

Cheers :)
 
I've got another problem now....

I am trying to do a similar function - but I think I am looking at buttering my bread on both sides.

This is the code I have:

SELECT TBL_Employee.EmpID, TBL_Employee.FirstName, TBL_Employee.LastName FROM TBL_Employee UNION SELECT '0', "Select from dropdown to search", " " FROM TBL_Employee
ORDER BY TBL_Employee.FirstName, TBL_Employee.LastName;


When the combo is displayed, I have the default value set to '0' to display "Select from dropdown to search". However, this also appears in my dropdown (about midway as I have sort ascending on FirstName).

Is there any way, even if it's not the method I am using now, we can NOT display this line in the combo?

Thanks for any help.
NKA
 

Users who are viewing this thread

Back
Top Bottom