Omit blank row when combo open

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello!

I have a F_Patrim based in T_Cad.
In this form I have Cbo88 with
SELECT DISTINCT [T_Cad].[Name], [T_Cad].[Name] FROM T_Cad;
in RowSource.
Work fine but when we open the combo, appear a top blank row.
When is possible omit it, please.

Thanks in advance.
an
 
Hello!

I have a F_Patrim based in T_Cad.
In this form I have Cbo88 with
SELECT DISTINCT [T_Cad].[Name], [T_Cad].[Name] FROM T_Cad;
in RowSource.
Work fine but when we open the combo, appear a top blank row.
When is possible omit it, please.

It sounds like there is a record in T_Cad with a blank (NULL) value
for Name. Either delete that record or use a criterion of IS NOT NULL.

One question out of curiosity: you have the Name field included TWICE.
Why? Or was that a typo? Try

SELECT DISTINCT [T_Cad].[Name], [T_Cad].[Name] FROM T_Cad
WHERE [T_Cad].[Name] IS NOT NULL
ORDER BY [Name];

or just select the Name field once and set the column count of the
combo to 1.

John W. Vinson[MVP]
 
Add the "Not Null" criteria to the appropriate field in the combo box's
underlying query.
 
John Vinson,

Thank you for your help.
Work fine!

-"you have the Name field included TWICE. Why?"
My ignorance.

Thanks one more time.
an

John Vinson said:
Hello!

I have a F_Patrim based in T_Cad.
In this form I have Cbo88 with
SELECT DISTINCT [T_Cad].[Name], [T_Cad].[Name] FROM T_Cad;
in RowSource.
Work fine but when we open the combo, appear a top blank row.
When is possible omit it, please.

It sounds like there is a record in T_Cad with a blank (NULL) value
for Name. Either delete that record or use a criterion of IS NOT NULL.

One question out of curiosity: you have the Name field included TWICE.
Why? Or was that a typo? Try

SELECT DISTINCT [T_Cad].[Name], [T_Cad].[Name] FROM T_Cad
WHERE [T_Cad].[Name] IS NOT NULL
ORDER BY [Name];

or just select the Name field once and set the column count of the
combo to 1.

John W. Vinson[MVP]
 
Back
Top