473,320 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

hide/show a combobox

hi guyz
I've a list for combobox1:"Kine","Aquaquam","Mahlet" and "Testament" as well for that of combobox2: "Old Testament" and "New Testament".
So Combobox2 should be displayed in the form-view if value of Combobox1 is "Testament".
I've attempt the following code:
Expand|Select|Wrap|Line Numbers
  1. private sub bombobox1_BeforUpdate()
  2. if combobox1 = "Testament" then
  3.   combobox2.visible = false
  4. else
  5.   combobox2.visible = true
  6. endif
  7. me.requery
  8. me.refresh
  9. me.repaint
  10. end sub
Thank you in advance
Jun 29 '12 #1
2 4887
Seth Schrock
2,965 Expert 2GB
What happens? Do you get an error message, or does combobox2 just remain visible?

It would probably work better to put your code in the combobox1 After_Update event instead of the before_update event. You also shouldn't need the Me.requery, me.refresh, and me.repaint commands.

(don't forget to use the code tags when posting code. Use the button that says <code/> to enter your code so that viewing is easier.)
Jun 29 '12 #2
Mihail
759 512MB
Your logic do not fit your implementation.
You say:
So Combobox2 should be displayed in the form-view if value of Combobox1 is "Testament".
But the implementation is:
Expand|Select|Wrap|Line Numbers
  1. if combobox1 = "Testament" then
  2.   combobox2.visible = false
  3. else
  4.   combobox2.visible = true
  5. endif
So, if combobox1 = "Testament" then combobox2 will not be visible. Isn't it ?

Replace your lines 3 to 6 with this one:
Expand|Select|Wrap|Line Numbers
  1. combobox2.visible = (combobox1 = "Testament")
Jun 30 '12 #3

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

Similar topics

9
by: Robb Gilmore | last post by:
Hello, This is probably an easy one, but I have not been able to figure it out so far. I have a tab control on a windows forms app. Depending on some business logic, I need to hide/show some...
2
by: Sandra | last post by:
Hello, I want to develop an application for WindowsCE using eMbedded Visual C++ 4.0. Is it possible to add/delete or hide/show toolbars by running the application. e.g. the user choose a menuitem...
4
by: jerryyang_la1 | last post by:
I've found this script that allows be to hide/show form elements.. <script language="JavaScript"><!-- var toggle = true; function show(object) { if (document.layers && document.layers)...
1
by: Norman | last post by:
Hello All, I have developed the ASP.Net application using .Net 1.1. I want to get one section of the page under hide/show feauture. That means when the user clicks on display I want to display all...
2
by: Greg | last post by:
Hello, I am trying to display order ids and order details (order items). I would like to give the user Hide/Show option to either display or hide order details. The page would look like: ...
1
by: roni | last post by:
hi. i have webform with 4 panel that i switch then in wizard style ( asp 1.1) . i want to know if i can hide/show the asp panel control IN THE CLIENT SIDE ? meaning, show panel 1 . user enter...
4
by: =?Utf-8?B?U3JpZGhhcg==?= | last post by:
Hi, Is it possible to Hide/Show controls during a callback? I have a radio button list that does the callback. When it does the callback I need to refresh the grid to reflect the selected value...
6
elamberdor
by: elamberdor | last post by:
Hi All! Trying to get a drop down hide/show div on a html page triggered by a button in flash. (Intro: Very very Little experience in dynamic flash) setup: html page, flash map on page, button...
15
by: worked | last post by:
I have a script that hides / shows form elements, and wrapped in a tab script (tab navigation). When the code is duplicated (per tab content), the hide / show function works for the first tab but...
11
by: dmorand | last post by:
I'm having some trouble with my javascript which is supposed to hide/show a div element. I have to click on the link twice before it'll hide. I can't seem to figure out why the first click does...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.