Problem with an expression

ddrew

seasoned user
Local time
Today, 01:55
Joined
Jan 26, 2003
Messages
911
Can someone tell me where I have gone wrong with this expression please. The query is looking for a match with coloumn 1 in the combobox, but its throwing an error:

Undefined function 'Forms![frm_Profile]![frm_Mating].Form![cbo_MatingDog]![column]' in expression

Code:
Forms![frm_Profile]![frm_Mating].Form![cbo_MatingDog]![column](1) & Chr(13) & Chr(10)
 
I don't believe you can use the bang (!) to reference a property, in this case .Column, so try . . .
Code:
Forms![frm_Profile]![frm_Mating].Form![cbo_MatingDog][B][COLOR="Red"].[/COLOR][/B][column](1) & Chr(13) & Chr(10)
 
I don't believe you can use the bang (!) to reference a property

That is certainly the problem. A bang will look down through the items in a collection or items in the chain of the default collections where an object name is not a collection.

So the following work

Forms!formname!controlname
Forms!formname!subformname!controlname (via .Form!Controls)
Forms!formname!subformname!fieldname (via .Recordset!Fields)

But properties must always be referred to with a dot.
 

Users who are viewing this thread

Back
Top Bottom