473,839 Members | 1,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hiding a control in focus on click of another control in ms access 2007?

99 New Member
I have a combobox and also a label on the same form.On click of the label, the combobox is to be made invisible.the problem is if the combobox is in focus and the label is clicked, it throws error saying that You can't hide a control which is in focus.I tried setting focus on the label itself when it is clicked but it didn't work.I also tried putting this code I found in one of the discussion forum
Expand|Select|Wrap|Line Numbers
  1. Sendkeys"{TAB}"
  2. DoEvents
it didn't work.
Also tried the following without any result
Expand|Select|Wrap|Line Numbers
  1. Screen.ActiveControl.Name=label1
Mar 2 '12 #1
5 1591
759 Contributor
Move the focus to the form itself before hide the combo box:
Expand|Select|Wrap|Line Numbers
  1. me.SetFocus
Mar 2 '12 #2
99 New Member
Again: didn't work
same error
Mar 2 '12 #3
2,322 Recognized Expert Moderator Top Contributor
You need a visible, enabled textbox (or combo/listbox) to move focus too, before hiding the combobox.

You cannot set focus to a label.
Mar 2 '12 #4
99 New Member
Oh. Thanks.I found the similar answer on the site of "msdn" but I was skeptical about it as it wasn't mentioned explicitly.
Mar 2 '12 #5
32,584 Recognized Expert Moderator MVP
I found the similar answer on the site of "msdn".
Indeed. It's always a good idea to search for an answer before posting a question. We're happy to answer your questions, but it will save you a lot of time and energy. Also, the more you do that the better able you are to find the best answers.
Mar 3 '12 #6

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

Similar topics

by: Angel | last post by:
I have a Win application with two child windows (formX and formY) that are both opened when the application loads. formX has a multi-line textbox that I use to enter an address, and two button controls (one processes the address, the other clears the textbox). If I start working on this form (typing the address and processing it with one of the two buttons), everything works fine. If I then go to formY (to do something entirely different)...
by: Quentin Huo | last post by:
Hi: I have a user control and I want to dynamically create a Label control and TextBox control when the button "add more author name" is clicked. I did like this: 1. there is a "PlaceHolder" control "ph" in the user control; 2. create a Label control and TextBox control when in the "add" button
by: MattB | last post by:
I have a page with several user controls on it. Some of the UC's have multiple text boxes that get auto-populated via the OnTextChanged event. When this happens, I lose my focus (where the blinking cursor is). I have some SetFocus JavaScript that works from a page event, but I'm not sure what I'd need to change to make it work from within a UC and have it set focus to another control inside another UC. To complicate this further, I'd...
by: scotprince | last post by:
Hi, I am hoping someone here can help. I have one custom control called "MyButton". On another custom control (CC2) I dynamically create a table and add the "MyButton" control to a cell or cells depending on what happens on the web form. Then I embed CC2 onto a web form and everything compiles and runs. I get the custom button(s) generated. The problem is that the button click event is not firing on the web form. Below is the code...
by: StyrofoamSUV | last post by:
Hello all. I am interested in hiding a ListView Control underneath a TabControl. The ListView Control will contain say, 5 columns. When the user selects 1 of the tabs, I want to show the ListView and 3 columns (the other 2 will be hidden). When the user selects the other tab, I want to show the other 2 columns of the ListView. Is there a way to do this without creating two ListViews? I have tried using all the Focus, Selected, and Show...
by: Wayne | last post by:
I've been having a click around Access 2007 this afternoon and have discovered some things that range from annoying to alarming. My Access 2003 menu bars, which I, like many others, use extensively, are now hidden behind an "Add Ins" tab on the Ribbon. Hardly an intuitive place for a user to find them. Unless my memory is failing me, I'm sure that Access 2003 menus displayed normally in the 2007 Beta. The other thing I've discovered...
by: Ryan | last post by:
Hello, I am starting the use the new ajax.net and I am seeing a bizarre behavior when controlling focus from the codebehind. I have tried: <control>.focus page.setfocus(<control>) CType(Master.FindControl("<form id>"), HtmlForm).DefaultFocus =
by: fifothekid | last post by:
Hi everybody, I made a primitive cost control database system using Microsoft Access 2007 as a front-end (don't ask my why did I use Microsoft Access!!!) and SQL Server 2005 Enterprise as a back-end This program depends on regrouping data, so I have sections and each section in front of it has the total of it's item Everything is working smoothly, except that the last line in any list, which is empty, gives me #Error in calculated controls...
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of the screen. I have been unable to find any way to disable this button in Access 2007 and subsequently I have been forced to find ways to detect and handle the situations after the Access Close button has been clicked. I have been largely...
by: vikram rawat | last post by:
I want to ask solution of one problem that is: - supppose there is two control in a panel, whenever i drag the one control near the another control in a panel, then it show a dot imag near that control and when i take the control far away from that control then dot image disappear. and this process goes on untill i drop the control. how to solve this problem?
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.