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

Data Access Page - how to change visibility based on criteria?

P: 11
Hi - I'm putting together a status report summary for a team of about 15 based in the US (various places), London, Hong Kong, etc. The users have expressed interest in using a web form (data access page), which I have submitting data to an Access db on a shared network repository. They want the forms to be saved in a Sharepoint repository for easy access. So far, so good.

Where I need a little help is in setting the data access page to hide or show some controls based on the type of update being submitted. For example, if they select the option "OUTAGE" from a combobox control, I want to show fields A, B and C, but hide X, Y and Z.

I'm sure I could convince them to ditch Sharepoint and just put a shortcut to a form (instead of the data access page), but I'd like to give them what they asked for if it's possible.

Thank you for any help!
JP
Oct 30 '08 #1
Share this Question
Share on Google+
3 Replies


DonRayner
Expert 100+
P: 489
Hi - I'm putting together a status report summary for a team of about 15 based in the US (various places), London, Hong Kong, etc. The users have expressed interest in using a web form (data access page), which I have submitting data to an Access db on a shared network repository. They want the forms to be saved in a Sharepoint repository for easy access. So far, so good.

Where I need a little help is in setting the data access page to hide or show some controls based on the type of update being submitted. For example, if they select the option "OUTAGE" from a combobox control, I want to show fields A, B and C, but hide X, Y and Z.

I'm sure I could convince them to ditch Sharepoint and just put a shortcut to a form (instead of the data access page), but I'd like to give them what they asked for if it's possible.

Thank you for any help!
JP
in the "After Update" event procedure for the combobox control use either IF or Select Case arguments to set each of the fields visible properties based on the value of the combobox. Eg:
Expand|Select|Wrap|Line Numbers
  1. If me.combobox = "update1" then
  2.   me.control1.visible = true
  3.   me.control2.visible = false
  4. Elseif me.combobox = "update2" then
  5.   me.control1.visible = false
  6.   me.control2.visible = true
  7. Elseif...... (up to however many selections you have)
  8.  
  9. Else
  10.   me.control1.visible = false
  11.   me.control2.visible = false
  12. End If
  13.  
Or with a Case statement
Expand|Select|Wrap|Line Numbers
  1. Dim mycontrol as string
  2. mycontrol = me.combobox.value
  3. select case mycontrol
  4.   case "update1"
  5.     me.control1.visible = true
  6.     me.control2.visible = false
  7.   case "update2"
  8.     me.control1.visible = false
  9.     me.control2.visible = true
  10.   case....(up to however many selections you have)
  11.  
  12.   case else
  13.     me.control1.visible = false
  14.     me.control2.visible = false
  15. End Select
  16.  
Oct 30 '08 #2

P: 11
This is fantastic! Thanks a million
Nov 10 '08 #3

DonRayner
Expert 100+
P: 489
Glad I could be of some help
Nov 11 '08 #4

Post your reply

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