469,575 Members | 1,695 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

Making Fields visible/invisible using a macro

jo3n
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
4 9696
ADezii
8,800 Expert 8TB
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
32,198 Expert Mod 16PB
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
8,800 Expert 8TB
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
32,198 Expert Mod 16PB
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.

Similar topics

3 posts views Thread by Dakkar | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.