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
hide a control that has the focus'.
If I click back on the top level datasheet record first, this doesn't
happen however anything I try in code to before making the first
subform invisible seems to fail to avoid the possibility of this error
arising, including setting the focus to a control on the first subform,
locking and disabling all controls on the second subform and the second
subform itself. Nothing now happens if I click on the second subform,
but I still get this error if I now make the first subform invisible
before clicking on a control on the first subform.
I'm using Access 2002 FYI. Any ideas?
James 2 4488
Ideas:
You could debug this item by grabbing me.ActiveContro l immediately prior to
the statement that is trying to hide the control.
You can also set the focus on a control that will remain visible immediately
prior to the statement that is trying to hide the control.
Good luck
Curt
"James" <ji****@hotmail .com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. . 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 hide a control that has the focus'.
If I click back on the top level datasheet record first, this doesn't happen however anything I try in code to before making the first subform invisible seems to fail to avoid the possibility of this error arising, including setting the focus to a control on the first subform, locking and disabling all controls on the second subform and the second subform itself. Nothing now happens if I click on the second subform, but I still get this error if I now make the first subform invisible before clicking on a control on the first subform.
I'm using Access 2002 FYI. Any ideas?
James
Hi Curt
Hey thanks I tried setting the focus to a control on the first subform
that I was making invisible but this didn't work but when I set the
focus to a control outside the 2 subforms, that worked fine!
cheers
James This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Nitin |
last post by:
Hi
I have created function to check date and time. at the time of
execution, if date is left empty the function returns the error
message but then the focus goes to next field. Next filed is for time
and there is also a check on that. If time is empty return error
message. Again the explorer returns error message and then shifts the
focus to date field, again error message and focus goes to time and
this story goes on and on, untill...
|
by: Paul Malcomson |
last post by:
Hi.
I'm having terrible trouble with a form that displays several
parent/child relationships at one time. It is a sales force hierarchy
- Sales force, district, territory, sales rep are the tables linked in
parent/child relationships.
I'm using a form to choose the main-parent and then several subforms
in datasheet view.
|
by: astro |
last post by:
I'm trying to get a subdataSheet embedded on a form which will be displayed
in datasheet view.
I setup the 'record source' for the form to a query on a table. I go into
the query properties and setup a subdatasheet. I test this and it works. I
close the query builder - get prompted to save - reply yes. I reopen the
'record source' and the subdatasheet setting are gone.
Any ideas?
|
by: Elaine |
last post by:
Hi
I have created a form which contains a subform.
To cut a long story short, I have created a macro that moves the focus to
the subform (GoToControl) and sets a value (SetValue) in the field on the
subform that recieves the focus.
The basic steps of the macro are:
|
by: kberry |
last post by:
I am clearing Textboxes on a form... this is loop I have came up with
but was wondering if it can be shorter or not as long... Can anyone
help?
Dim controlOnForm As Control 'Places a control on the form
Dim controlOnTab As Control 'Places a control on the tab
Dim controlTabPage As Control 'Places a control on the tab
page
Dim controlGroupBox As Control 'Places a control on the group
box
| |
by: ray |
last post by:
I am at the moment manually setting Subdatasheet to in all the
tables in this adp.
If anybody can put me out of my misery by suggesting some automated way
to do it, I would be most grateful. I can't work out how to get ADO or
the ADOX catalog to do it, and DAO doesn't connect to projects. I am
now up to table 75 out of 425 in Systest, and I will have to do it
again in UAT and Prod. Ewwwww. This is the thirty-eighth most boring
thing I...
|
by: Bob |
last post by:
Hi,
Hope you can help me with this one. I'm at my wits end. I'm trying to
create an intelligent edit-box like the
excellent "Customer" one at the URL:
http://munich.schwarz-interactive.de/autocomplete.aspx
|
by: Simon |
last post by:
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.
|
by: Dan2kx |
last post by:
Hello,
I have another problem to which i cannot figure out a resolution,
I have a listbox on a form, on double click event of a row in the listbox i want to run some code, update tables etc
then i want to run another procedure that updates the "Main" listbox to show the change made in the other, and i want to hide the original listbox, make sense?
well, i get the error "cannot hide control that has the focus", i understand the error but...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |