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

Displaying a Cell

P: 8
I need a field on a form to display if three out of the four options are displayed.

So i have:

Option 1
Option 2
Option 3
Option 4

If Option 2 to 4 is selected in the combo box then display field 2

I've tried to code it myself but it doesnt like it and I don't know enough to keep guessing at it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub BuildingReg_AfterUpdate()   
  2. If Me.BuildingReg.Column(X) = "N/A" Then  
  3. Me.BuildingRegSubmit.Visable = False  
  4. Else  
  5. Me!BuildingRegSubmit.Visable  
  6. End If 
  7. End Sub
I think its completely wrong but anyhoo and help/insight would be greatly appreciated.
Sep 19 '08 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,619
This code is generic in that it makes no difference whatsoever what the Options in the Combo Box are named, it simply goes by their absolute position. If Options 2, 3, or 4 are chosen, then Field 2 will become visible, otherwise it will be invisible. Should you change the number of Options, or the manner in which Field 2 is displayed, the code must be changed. Make sure you place this in the AfterUpdate() Event of the Combo Box:
Expand|Select|Wrap|Line Numbers
  1. Private Sub BuildingReg_AfterUpdate()
  2. Select Case Me![BuildingReg].ListIndex
  3.   Case 1 To 3
  4.     Me.BuildingRegSubmit.Visible = True
  5.   Case Else
  6.     Me.BuildingRegSubmit.Visible = False
  7. End Select
  8. End Sub
Sep 19 '08 #2

Post your reply

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