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

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.Visible =
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 7021

"Simon" <Sv********@Versatel.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.Visible =
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.OtherComboBox.SetFocus

DoCmd.GoToControl "OtherComboBox"

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.nlschreef in bericht
news:48**********************@text.nova.planet.nl. ..

"Simon" <Sv********@Versatel.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.Visible =
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.SomeOtherControlName.SetFocus
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
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...
4
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
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()...
3
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
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. ...
1
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....
1
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...
9
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...

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.