johnclarke123
asked on
How check whether a form is bound to a recordset?
I have a form that I open, then bind a recordset to.
The form's On Current event fires when the form is first opened, before the recordset is bound, and trips an error, since the controls it examines are not yet populated.
How can I write a check to see whether there is a recordset present, to filter out these commands from On Current?
[NB it's possible that the error is due to something else, since only one of several lines in On Current triggers the error:
Me.SectionFinder.Value = Me.Controls("Type").Value
gives error 438: object doesn't support this property or method.]
Happy with an answer to either!
jc
The form's On Current event fires when the form is first opened, before the recordset is bound, and trips an error, since the controls it examines are not yet populated.
How can I write a check to see whether there is a recordset present, to filter out these commands from On Current?
[NB it's possible that the error is due to something else, since only one of several lines in On Current triggers the error:
Me.SectionFinder.Value = Me.Controls("Type").Value
gives error 438: object doesn't support this property or method.]
Happy with an answer to either!
jc
Hi johnclarke123,
I don't believe you can avoid the errors using this approach. The fields will show #Error until a valid recordsource is provided.
Why can't you set the form to a valid source and then change it to what you want.
Pete
I don't believe you can avoid the errors using this approach. The fields will show #Error until a valid recordsource is provided.
Why can't you set the form to a valid source and then change it to what you want.
Pete
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
urm, try 438 instead of 436
ASKER
That would do it.
Thanks a lot.
jc
Thanks a lot.
jc
Its tweaks galore day today :)
Thats exactly what Ive had to do with cross site scripting Im doing right now. Not exactly a generic solution but it works
Thats exactly what Ive had to do with cross site scripting Im doing right now. Not exactly a generic solution but it works
ASKER