If I am in a combobox, is there are way of determining which control
was clicked outside the combobox, before I actually leave the combobox?
I would like to make a decision at the combobox control about what
control
was clicked outside that box.
ThankYou 16 1370
On 9 Apr 2006 09:18:08 -0700, Ap******@gmail.com wrote: If I am in a combobox, is there are way of determining which control was clicked outside the combobox, before I actually leave the combobox? I would like to make a decision at the combobox control about what control was clicked outside that box.
ThankYou
Code a suitable ComboBox event:
If Screen.PreviousControl.Name = "SpecificControlName" then
etc........
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thankyou for your response Fred.
I'm not sure? But I believe your suggestion
implies that I have to leave the combobox to
get my answer, and this is what I do not want
to do. Am I correct?
is this a continuation of your question in last night's post titled "Require
Combobox Entry"? if so, i think salad's code, with a small revision, will
accomplish your goal of preventing the user from entering data in other
controls until a value is entered in the combo box control - while allowing
the user to exit the form entirely, without entering a value in *any*
control. try the following revised code in the combo box's AfterUpdate
event, as
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Then
ctl.Locked = IsNull(Me.Combo0)
End If
Next
hth
<Ap******@gmail.com> wrote in message
news:11********************@u72g2000cwu.googlegrou ps.com... If I am in a combobox, is there are way of determining which control was clicked outside the combobox, before I actually leave the combobox? I would like to make a decision at the combobox control about what control was clicked outside that box.
ThankYou
On 9 Apr 2006 10:16:41 -0700, Ap******@gmail.com wrote: Thankyou for your response Fred. I'm not sure? But I believe your suggestion implies that I have to leave the combobox to get my answer, and this is what I do not want to do. Am I correct?
Wouldn't this have been more quickly answered had you just tried it?
No you are not correct.
For instance, you can place the code in the combo box Enter event.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thankyou all very much for your responses! I am 2-months into coding
with access so please be patient. I appreciate the work-around option
offered by Salad in an earlier post and have used something similar
before.
I have tried Freds suggestion but it does not work for me. The Serial#
combobox
is the first control entered when the form starts up. So asking for the
Screen.PreviousControl.Name does not work.
What I specifically want to do, is what I originally asked:
If I am in a combobox, is there a way of determining which control
was clicked outside the combobox, before I actually leave the combobox?
THANKYOU AGAIN
"Ap******@gmail.com" <Ap******@gmail.com> wrote in
news:11*********************@e56g2000cwe.googlegro ups.com: Thankyou all very much for your responses! I am 2-months into coding with access so please be patient. I appreciate the work-around option offered by Salad in an earlier post and have used something similar before. I have tried Freds suggestion but it does not work for me. The Serial# combobox is the first control entered when the form starts up. So asking for the Screen.PreviousControl.Name does not work.
You have not experience enough with Access to have mastered the
concept in fredg's response, and that is that the moment you
have clicked outside the combobox you are outside the combobox.
Fredg's code returns you to the combobox.
What I specifically want to do, is what I originally asked: If I am in a combobox, is there a way of determining which control was clicked outside the combobox, before I actually leave the combobox?
you might as well ask "What is the sound of one hand clapping?"
(old Zen koan)
--
Bob Quintal
PA is y I've altered my email address.
well, to answer your specific question: AFAIK, no.
hth
<Ap******@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com... Thankyou all very much for your responses! I am 2-months into coding with access so please be patient. I appreciate the work-around option offered by Salad in an earlier post and have used something similar before. I have tried Freds suggestion but it does not work for me. The Serial# combobox is the first control entered when the form starts up. So asking for the Screen.PreviousControl.Name does not work.
What I specifically want to do, is what I originally asked: If I am in a combobox, is there a way of determining which control was clicked outside the combobox, before I actually leave the combobox?
THANKYOU AGAIN
Take another look at your previous post ---
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
Over 1175 users have come to me from the newsgroups requesting help re******@pcdatasheet.com
<Ap******@gmail.com> wrote in message
news:11*********************@e56g2000cwe.googlegro ups.com... Thankyou all very much for your responses! I am 2-months into coding with access so please be patient. I appreciate the work-around option offered by Salad in an earlier post and have used something similar before. I have tried Freds suggestion but it does not work for me. The Serial# combobox is the first control entered when the form starts up. So asking for the Screen.PreviousControl.Name does not work.
What I specifically want to do, is what I originally asked: If I am in a combobox, is there a way of determining which control was clicked outside the combobox, before I actually leave the combobox?
THANKYOU AGAIN
PC D wrote: Take another look at your previous post ---
--
To anyone reading this thread:
It is commonly accepted that these newsgroups are for free
exchange of information. Please be aware that PC Datasheet
is a notorious job hunter. If you are considering doing
business with him then I suggest that you take a look at
the link below first. http://home.tiscali.nl/arracom/whoissteve.html
Randy Harris
On 9 Apr 2006 11:03:43 -0700, Ap******@gmail.com wrote: Thankyou all very much for your responses! I am 2-months into coding with access so please be patient. I appreciate the work-around option offered by Salad in an earlier post and have used something similar before. I have tried Freds suggestion but it does not work for me. The Serial# combobox is the first control entered when the form starts up. So asking for the Screen.PreviousControl.Name does not work.
What I specifically want to do, is what I originally asked: If I am in a combobox, is there a way of determining which control was clicked outside the combobox, before I actually leave the combobox?
THANKYOU AGAIN
Why didn't you state that it was the first control to get focus in
your first message, or even when you replied to my first message?
Even in this message, just before the "THANKYOU AGAIN", you DO NOT
STATE that it was the first control. We are not mind readers!
All you need do is trap the resulting errors.
Place the following in the Combo Box's Enter event:
Private Sub ComboBoxName_Enter()
On Error GoTo Err_Handler
If Screen.PreviousControl.Name = "SomeControl" Then
' Do Something Here
Else
' Do somthing else here
End If
Exit_Sub:
Exit Sub
Err_Handler:
If Err = 2483 Or Err = 2467 Then
Else
MsgBox "Error: " & Err.Number & " " & Err.Description
End If
Resume Exit_Sub
End Sub
When done, your code should look just like this example, except the
name of your combo box will be where I have "ComboBoxName".
AND ...
Where I have written
If Screen.PreviousControl.Name = "SomeControl" Then
you will replace "SomeControl" with the name of the control and you
will write the action you wish to perform. You haven't said what it
is.
When opening the form no error will be generated, nor will any action
be done.
Only upon re-entering the combo box will the action be performed.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Personally I'd design the user interface better... ie. only show the
combobox, or split it over diff forms or pages only going the the second
setion once a value has been entered.
... or something like that.
fredg wrote: On 9 Apr 2006 11:03:43 -0700, Ap******@gmail.com wrote:
Thankyou all very much for your responses! I am 2-months into coding with access so please be patient. I appreciate the work-around option offered by Salad in an earlier post and have used something similar before. I have tried Freds suggestion but it does not work for me. The Serial# combobox is the first control entered when the form starts up. So asking for the Screen.PreviousControl.Name does not work.
What I specifically want to do, is what I originally asked: If I am in a combobox, is there a way of determining which control was clicked outside the combobox, before I actually leave the combobox?
THANKYOU AGAIN
Why didn't you state that it was the first control to get focus in your first message, or even when you replied to my first message?
Even in this message, just before the "THANKYOU AGAIN", you DO NOT STATE that it was the first control. We are not mind readers!
All you need do is trap the resulting errors. Place the following in the Combo Box's Enter event:
Private Sub ComboBoxName_Enter() On Error GoTo Err_Handler If Screen.PreviousControl.Name = "SomeControl" Then ' Do Something Here Else ' Do somthing else here End If
Exit_Sub: Exit Sub Err_Handler: If Err = 2483 Or Err = 2467 Then Else MsgBox "Error: " & Err.Number & " " & Err.Description End If Resume Exit_Sub End Sub
When done, your code should look just like this example, except the name of your combo box will be where I have "ComboBoxName". AND ... Where I have written
If Screen.PreviousControl.Name = "SomeControl" Then
you will replace "SomeControl" with the name of the control and you will write the action you wish to perform. You haven't said what it is.
When opening the form no error will be generated, nor will any action be done. Only upon re-entering the combo box will the action be performed.
--
regards,
Br@dley
In response to Br@dley.
I have spent too much time trying to get my original ideas to work.
I am now just going to build an input dialogbox containing the
Serialnumber ComboBox. This way I have control the entry in isolation.
Thanks for your thoughts! Ap******@gmail.com wrote: In response to Br@dley. I have spent too much time trying to get my original ideas to work.
I haven't followed your threads closely, though the
screen.previouscontrol does what you want.
However, one needs to ask oneself if I am trying to swim from Europe to
North America is it impossible to do? If I am having difficulty and
someone throws me a life bouy am I being silly by saying "no I've spent
too much time trying to make it across, I'll continue" even if it means
certain drowning?
If someone realizes you are trying to get through a brick wall by
banging your head against it and tells you, would you continue banging
your head?
Just a couple of analogies to consider...
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "What's UP, Dittoooooo?" - Ditto
Unfortunately Marshall, in my case your analogy applies to my effort to
get the
screen.previouscontrol to work. If your interested in tossing the
lifering, show
some specific code. This will satisfy more than here!
On Sun, 09 Apr 2006 18:35:20 GMT, "tina" <no****@address.com> wrote: well, to answer your specific question: AFAIK, no.
Top-posted or no, IAWTina.
I have no idea what fredg is on about. Seems he is looking at things
backwards from what the OP clearly wrote up. And (some) others are
echoing fredg's opinion. Perhaps they should take fredg's advice and
put together a sample before singing his praises and heaping scorn on
the OP.
Look to a variation on Salad's code to do what you want and ignore
this whole thread.
Jim
<Ap******@gmail.com> wrote in message news:11*********************@e56g2000cwe.googlegr oups.com... Thankyou all very much for your responses! I am 2-months into coding with access so please be patient. I appreciate the work-around option offered by Salad in an earlier post and have used something similar before. I have tried Freds suggestion but it does not work for me. The Serial# combobox is the first control entered when the form starts up. So asking for the Screen.PreviousControl.Name does not work.
What I specifically want to do, is what I originally asked: If I am in a combobox, is there a way of determining which control was clicked outside the combobox, before I actually leave the combobox?
THANKYOU AGAIN
Ap******@gmail.com wrote: Unfortunately Marshall, in my case your analogy applies to my effort to get the screen.previouscontrol to work. If your interested in tossing the lifering, show some specific code. This will satisfy more than here!
Ahh, OK good, I'm glad. 8)
I don't have anything specific to offer, unfortunately. I was just
generally concerned about sticking with an approach that might not be
fruitful. There are many people I've seen here who are just like me, in
that we are often too stubborn to give up on something... 8)
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Andrey Tatarinov |
last post by:
Hi.
It would be great to be able to reverse usage/definition parts in
haskell-way with "where" keyword. Since Python 3 would miss lambda, that
would be extremly useful for creating readable...
|
by: A.V.C. |
last post by:
Hello,
I found members of this group very helpful for my last queries.
Have one problem with CASE. I can use the column name alias in Order By Clause
but unable to use it in WHERE CLAUSE.
PLS...
|
by: Xiangliang Meng |
last post by:
Hi, all.
In 1998, I graduated from Computer Science Dept. in a university in China.
Since then, I've been using C Language for almost 6 years. Although I'm
using C++ in my current job, I'm also...
|
by: Britney |
last post by:
Original code:
this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " +
"country FROM dbo.users WHERE (has_picture = ?) AND (sex...
|
by: comp.lang.php |
last post by:
if ($willLimitByDB) $sql = preg_replace('/#(+)#/i', '$$1',
$sql);
This does not give me the results I want, instead of the value of
$where in $sql, I literally get '$where' instead.
How do I...
|
by: John |
last post by:
I just cannot manage to perform a SELECT query with NULL parameter...
My CATEGORY table does have one row where TCATEGORYPARENTID is null (real DB
null value).
TCATEGORYID and TCATEGORYPARENTID...
|
by: NeoPa |
last post by:
Background
Whenever code is used there must be a way to differentiate the actual code (which should be interpreted directly) with literal strings which should be interpreted as data. Numbers don't...
|
by: not_a_commie |
last post by:
I was hoping for increased functionality with the where clause in C#
3.0. Using the new keyword 'var' would really allow us to take nice
advantage of these. Specifically:
1. I want to limit it...
|
by: Emin |
last post by:
Dear Experts,
I have a fairly simple query in which adding a where clause slows
things down by at least a factor of 100. The following is the slow
version of the query
...
|
by: chrisdavis |
last post by:
I'm trying to filter by query or put those values in a distinct query
in a where clause in some sort of list that it goes through but NOT at
the same time. Example:
ROW1
ROW2
ROW3
ROW4 ,...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
|
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...
|
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: 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...
|
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: 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...
|
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,...
| |