473,406 Members | 2,867 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,406 software developers and data experts.

Select Case refreshment problem

Hi folks,
I have the following problem. In one of my forms (say FORM1) in ACCESS 2003, I have 3 toggle buttons which are inside a frame. Close to each of these buttons is a combox with a list of items. All the 3 comboxes correspond to 3 different categories (each list encircles one category) and are inside a TabControl (say TabCnt0). When the toggle button is pressed, the nearby list is shown (visible) and is available for the selection of the desired items, while the other two comboxes are then hidden.
Everything works perfectly, except that one pretty annoying thing happens. Immediately after the form is opened, all the 3 comboxes are visible. As soon as you click on one of the toggle buttons or on the frame, the two unselected comboxes disappear (as it should be) but if you reopen the form again, the same problem happens. I tries several ways to "refresh" somehow the form when it opens but without success. Does anybody know how to make it work so that whenever I open the form I see only one of the 3 choices?

Thanks in advance.

Marcin

PS The code I'm using right now is below:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Frame5_Click()
  2.  
  3. DoCmd.RunCommand acCmdRefresh
  4.  
  5. Select Case Frame5
  6.  
  7. Case 1
  8. CmbAssClass.Visible = True
  9. CmbReg.Visible = False
  10. CmbAssClassReg1.Visible = False
  11. CmbAssClassReg2.Visible = False
  12.  
  13.  
  14. Case 2
  15. CmbAssClass.Visible = False
  16. CmbReg.Visible = True
  17. CmbAssClassReg1.Visible = False
  18. CmbAssClassReg2.Visible = False
  19.  
  20.  
  21. Case 3
  22. CmbAssClass.Visible = False
  23. CmbReg.Visible = False
  24. CmbAssClassReg1.Visible = True
  25. CmbAssClassReg2.Visible = True
  26.  
  27. End Select
  28.  
  29. End Sub
  30.  
  31.  
May 20 '10 #1
1 1236
missinglinq
3,532 Expert 2GB
First off, you need to take your code out of the Frame5_Click() event and move it to the Frame5_AfterUpdate() event. The Click event will fire if the frame itself is clicked, not only if one of the toggles is clicked, and can cause an error.

Next, for the proper comboboxe(s) to show/not show, when the form opens and when moving from record to record, you need to also have the same code in the Form_Current() event.

Linq ;0)>
May 20 '10 #2

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

Similar topics

17
by: Newbie | last post by:
Dear friends, I am having a hard time understanding how to use a SELECT CASE in ASP. I have used it in VB but never in ASP scripting. Scenerio: I have 2 textboxes on a form that I have to...
2
by: Tim Graichen | last post by:
Could somebody please help me out with this easy one? I have a five button toggle set up. Case 1-4 work fine, so I have ommitted the code from this post. I need help with Case 5. Case five...
2
by: JMCN | last post by:
hello i have your basic select case question. i created a combo box and save it as a query. so whenever the user selects the value and clicks the export button, the select case should then export...
10
by: MLH | last post by:
Suppose the following... Dim A as Date A=#7/24/2005# I wish to compare value of A against 2 other values: 1) 8/1/2005 2) 9/1/2005 Which is better and why... First:
3
by: mark.irwin | last post by:
Hello all, Have an issue where a redirect pushes data to a page with a select case which then redirects to another page. Problem is the redirect isnt working in 1 case. Code below: strURL =...
8
by: | last post by:
Hello, This is gonna sound real daft, but how do I test a Select Case statement for variants of a theme? Here's a snippet of my code... Select Case sUsr Case "Guest", "TsInternetUser",...
2
by: scole954387 | last post by:
Hi, I have a problem. I have written a SQL statement that has a nested select case statement on the 'where' clause to condition the results. ...
1
by: microsoft.public.dotnet.languages.vb | last post by:
Hi All, I wanted to know whether this is possible to use multiple variables to use in the select case statement such as follows: select case dWarrExpDateMonth, dRetailDateMonth case...
0
by: bitong | last post by:
Please give me some hints on how to finish my program..the problem is i have to make a program wherein i will type the start time and the end time, get the length of time..using the 24 -hour clock....
21
beacon
by: beacon | last post by:
Hello to everybody, I have a section on a form that has 10 questions, numbered 1-10, with 3 option buttons per question. Each of the option buttons have the same response (Yes, No, Don't know),...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.