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

Making Fields visible/invisible using a macro

jo3n
P: 1
I know I saw it here last week but can't locate it now. What is the syntax/settings for making fields in a form (subform) visible/invisible based on a combo box?
May 21 '07 #1
Share this Question
Share on Google+
4 Replies

ADezii
Expert 5K+
P: 8,750
I know I saw it here last week but can't locate it now. What is the syntax/settings for making fields in a form (subform) visible/invisible based on a combo box?
Expand|Select|Wrap|Line Numbers
  1. If Me![cboSomeComboBox] = <some value> Then
  2.   Me!<some form field>.Visible = True      'For a Form Field
  3.   Me!<sub-form control name>.Form!<field name>.Visible = True      'Sub-Form Field
  4. Else
  5.   Me!<some form field>.Visible = False
  6.   Me!<sub-form control name>.Form!<field name>.Visible = False
  7. End If
May 22 '07 #2

NeoPa
Expert Mod 15k+
P: 31,770
Alternatively :
Expand|Select|Wrap|Line Numbers
  1. 'For a Form Field
  2. Me.<some form field>.Visible = (Me.[cboSomeComboBox] = <some value>)
  3. 'Sub-Form Field
  4. Me.<sub-form control name>.Form!<field name>.Visible = (Me.[cboSomeComboBox] = <some value>)
Jun 2 '07 #3

ADezii
Expert 5K+
P: 8,750
I know I saw it here last week but can't locate it now. What is the syntax/settings for making fields in a form (subform) visible/invisible based on a combo box?
NeoPa's alternative is much better - use it instead of mine.
Jun 2 '07 #4

NeoPa
Expert Mod 15k+
P: 31,770
NeoPa's alternative is much better - use it instead of mine.
Thanks A.
Both ways will work fine. It's a matter of personal preference really.
Jun 2 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.