473,385 Members | 1,912 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,385 software developers and data experts.

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

99
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

✓ answered by TheSmileyCoder

You need a visible, enabled textbox (or combo/listbox) to move focus too, before hiding the combobox.

You cannot set focus to a label.

5 1577
Mihail
759 512MB
Move the focus to the form itself before hide the combo box:
Expand|Select|Wrap|Line Numbers
  1. me.SetFocus
Mar 2 '12 #2
HiGu
99
Again: didn't work
same error
Mar 2 '12 #3
TheSmileyCoder
2,322 Expert Mod 2GB
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
HiGu
99
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
NeoPa
32,556 Expert Mod 16PB
HiGu:
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

0
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...
2
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...
0
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...
0
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...
1
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...
2
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...
1
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>)...
1
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...
5
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
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,...
0
jinu1996
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...

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.