473,791 Members | 3,074 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

You can't hide a control that has the focus

Dear reader,

On the event "Lost focus" I make the ComboBox invisible but the massage pops
up

"You can't hide a control that has the focus." But this code is written in
the "Lost focus" event so the combobox has not longer the focus regarding
this event.

And if I set the focus to an other control, the code Me.ComboBox.Vis ible =
False

delivers still the massage: "You can't hide a control that has the focus."

The question is now:

How to move the focus from the ComboBox and hide the ComboBox.

Tanks for any help.

Kind regards,

Simon

Jun 27 '08 #1
3 7045

"Simon" <Sv********@Ver satel.nlschreef in bericht news:48******** *************** @news.tele2.nl. ..
On the event "Lost focus" I make the ComboBox invisible but the massage pops
up

"You can't hide a control that has the focus." But this code is written in
the "Lost focus" event so the combobox has not longer the focus regarding
this event.
So don't use that event for this action. . .

And if I set the focus to an other control, the code Me.ComboBox.Vis ible =
False

delivers still the massage: "You can't hide a control that has the focus."

The question is now:

How to move the focus from the ComboBox and hide the ComboBox.
Oh please. . .
FIRST set focus to another control,
THEN make your combo invisible. . .

Arno R
Jun 27 '08 #2
I tried every think to move the focus from the combox but nothing works.

Me.Repaint

Me.OtherComboBo x.SetFocus

DoCmd.GoToContr ol "OtherCombo Box"

But still the message appears:

"You can't hide a control that has the focus."

The question is how to remove the focus from the combobox?

Regards,

Simon
"Arno R" <ar************ ****@planet.nls chreef in bericht
news:48******** **************@ text.nova.plane t.nl...

"Simon" <Sv********@Ver satel.nlschreef in bericht
news:48******** *************** @news.tele2.nl. ..
On the event "Lost focus" I make the ComboBox invisible but the massage
pops
up

"You can't hide a control that has the focus." But this code is written
in
the "Lost focus" event so the combobox has not longer the focus
regarding
this event.
So don't use that event for this action. . .

And if I set the focus to an other control, the code
Me.ComboBox.Vis ible =
False

delivers still the massage: "You can't hide a control that has the
focus."
>
The question is now:

How to move the focus from the ComboBox and hide the ComboBox.
Oh please. . .
FIRST set focus to another control,
THEN make your combo invisible. . .

Arno R

Jun 27 '08 #3
Simon wrote:
I tried every think to move the focus from the combox but nothing
works.
It is not the code you are using. This should work fine...

Me.SomeOtherCon trolName.SetFoc us
Me.ComboBoxName .Visible = False

It is the event you are using. Some control events cannot be used to set
focus to another control. You just need to use a different event.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
4488
by: James | last post by:
Hi I have set up a subform in datasheet mode containing a second subform also in datasheet mode in order to be able to open it as a subdatasheet. In my application I make the first subform appear and disappear using the Visible property. If I make it visible (in code), open the subdatasheet (via mouse) and click anywhere on the subdatasheet, then make it invisible (in code) I get the infamous error 2165 'You can't
4
3946
by: KVV | last post by:
Hello, All! can i hide property1 in designer depending on property2 value With best regards, KVV. E-mail: kvv_vlad@ua.fm
1
2249
by: Sharon | last post by:
I’m sending mail form my C#/.NET assembly, and for that I’m doing authentication like that: MailMessage MyMail = new MailMessage() MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "UserName") MyMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", " password"); And by using tools like...
3
1831
by: Paul | last post by:
Just wondering if there is a way to give a control focus when the page loads, for example so the user could start typing in a text box before clicking on it? Thanks, -- Paul G Software engineer.
4
4817
by: Kent P. Iler | last post by:
Hi, I am showing/hiding a variety of panels that have different text boxes via code-behind functions. Depending on the condition, I would like to have the focus be set on a specific text box. However, all examples I've seen do this from the client side. Does anyone have a way to easily to specify the textbox to focus on from a code-behind function? My guess is it will have to be some combination of server-side and client-side...
1
5742
by: Jason | last post by:
I am creating my own tab control in vb.net. I am inheriting System.Windows.Forms.TabControl. I want to provide a property that disables or enables the focus rectangle being drawn on the tabs. Setting the DrawMode to OwnerFixed and adding the drawing methods in overrides OnDrawItem doesn't seem to do it. The focus rectangle is drawn no matter what is drawn in the OnDrawItem event. How can I prevent the focus rectangle from being drawn? ...
1
1968
by: robin9876 | last post by:
In Asp.Net v1.1 web form I have a number of controls which have the autopostback enabled. Is it possible after the autopostback has run that the control that caused the autopostback to get the focus?
9
18022
by: Zytan | last post by:
http://msdn2.microsoft.com/en-us/system.windows.forms.control.focus(VS.80).aspx this page says: "Focus is a low-level method intended primarily for custom control authors. Instead, application programmers should use the Select method or the ActiveControl property for child controls, or the Activate method for forms." I am trying to give a Numeric UpDown control focus. Only Focus() works. But this says to not use it.
0
1023
by: =?Utf-8?B?U2hhcm9u?= | last post by:
Hello Gurus, Using VS2005 with .NET Framework 2.0. I wrote a GUI control A derived from UserConstrol, this control contains another UserControl derived B which contains two Labels controls and two NumericUpDown controls. The trouble is: After one of the NumericUpDown get the focus by mouse click on it, I can not
0
10428
Oralloy
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...
0
10207
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 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...
1
10156
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,...
0
9997
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 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...
0
9030
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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 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...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4110
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
2
3718
muto222
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.