fao:Nikos

  • Thread starter Thread starter CY
  • Start date Start date
C

CY

Nikos

Thanks for your help with my combo box problem. I tried what you suggested
but am having trouble.

Here's what the rowsource currently says:

SELECT tblNewUtilityCo.UtilityID, tblNewUtilityCo.State,
tblNewUtilityCo.UtilityCo, tblNewUtilityCo.Type
FROM tblNewUtilityCo
WHERE (((tblNewUtilityCo.State) Like [Forms]![frm-MasterForm]![State]) AND
((tblNewUtilityCo.Type)="electricity"));


I just added the

SELECT " Select a Utility Company", "", ""

to the top of it but I get an error

Query input must contain at least one table or query"

Did I do something wrong??

Thanks!
 
Already replied in the original thread, but I'll try again, now having
the actual existing query. Try this one instead:

SELECT 0, " ", "Select a Utility Company", " "
FROM tblNewUtilityCo

UNION SELECT UtilityID, State, UtilityCo, Type
FROM tblNewUtilityCo
WHERE State Like [Forms]![frm-MasterForm]![State] AND Type="electricity"

This is based on the assumptions that (a) UtilityID is numeric, (b)
there is no utility with a 0 ID, (c) the UtilityID field is the bound
one, and is not visible.
The other thing you need to do is set the combo's default value to 0, so
the "Select a Utility Company" appears before a selection is made.

Let me know if I'm wrong on one or more assumptions, so it doesn't work.

HTH,
Nikos
 
Good! Glad to have helped. No genius here, just started off earlier (I
guess).

Regards,
Nikos
 
Back
Top