By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,222 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,222 IT Pros & Developers. It's quick & easy.

Change enabled on control based on data in subform?

P: n/a
Ron
Hi all,

I've got a combo box control (cboYoMomma) on a main form (frmMain) that I
want to enable only if a subform (sfrmSubForm) does not have any records in
it. But, once there are records in the subform I want to un-enable that
combo list so it can't be changed. And, if all the records on the subform
are removed, I want to re-enable that combo box control.

Is that possible? And if so, how?

TIA
ron
Aug 15 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ron wrote:
Hi all,

I've got a combo box control (cboYoMomma) on a main form (frmMain) that I
want to enable only if a subform (sfrmSubForm) does not have any records in
it. But, once there are records in the subform I want to un-enable that
combo list so it can't be changed. And, if all the records on the subform
are removed, I want to re-enable that combo box control.

Is that possible? And if so, how?

TIA
ron

In the OnCurrent event of MainForm enter
Me.cboYoMamma.Enabled = (Me.sfrmSubForm.Form.Recordsetclone.RecordCount
= 0)

In the AfterDate event of the Subform enter
Forms!MainForm!cboYoMamma.Enabled = False

I suppose you might want to do a check if you delete records too in the
subform.
Aug 15 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.