Combo RowSource

Dave Eyley

Registered User.
Local time
Today, 20:30
Joined
Sep 5, 2002
Messages
254
Does anybody know of a way to check a Combo's Rowsource result to see if anything will appear in the combo before it's used.

e.g.

I have a Property database with Combos to locate the Space in the property -

1. Site
2. PropertyName - based on Site above
3. Block - Based on Property above
4. Level - based on property & Block above
5. Space(Room) - based on Block & Level of property

If a property is a single block then no data exists for Blocks and the Block Combo List will be empty. I need to find out whether this List will be Null so that I can skip the Block and base the Space Rowsource on just the Property/Level.

Using the same statement as the RowSource SQL seems the most likely solution but any other advice would be gratefully received.

Dave E
 
Dave,

At a glance, I vote for code using the SQL in the combo, making and saving a query (with the same or equivalent SQL) and checking its return value when appropriate...

Code:
Dim lngResult as Long

lngResult=Dcount("FieldInQuery","QueryName")

If lngResult = 0 Then 
	me.comboX.rowsource = This SQL
Else
	me.comboX.rowsource = That SQL
End if

Regards,
Tim
 
Thanks Tim,

I'll give it a try - it looks good.

Dave E
 
Dave,

Glad to hear it.

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom