- Local time
- Today, 04:13
- Joined
- Feb 19, 2002
- Messages
- 45,912
I'm running O365 with a fairly recent update.
What is June7 running?
What is June7 running?
But if you don't ever Exit first, how can you possibly lose focus? That would mean you never exited in my mind.WOW!!! I just noticed that Exit runs before LostFocus. That is bizarre. I thought the "exit" side events run opposite the "enter" side events. so 8. should be LostFocus and 9. should be Exit?????
Those are the only two arrows I see.Please clarify what is meant by "down arrow" in relation to listbox. Is this the arrow on scrollbar?
But then logically the Got Focus should occur before the Enter (which I thought was how it worked before I built this database). They should bracket the other events.But if you don't ever Exit first, how can you possibly lose focus? That would mean you never exited in my mind.
They differ in terms of when they occur. Exit occurs before LostFocus. They differ in the respect that the Exit event can be canceled, LostFocus cannot. So, which one you use depends somewhat on what you want to do in that event.I'm not even sure why we have both Enter/Exit and Got/Lost Focus. Is there some different purpose they are supposed to serve?
listbox.ItemsSelected(
you get a tooltip that says Item(Index) As Long. If you then remove the initial parentheses like listbox.ItemsSelected
you get a tooltip that says ItemsSelected As _ItemsSelected, Giving you access to the internal name of the class, which should be private, hence the underscore. If it behaved like other well coded classes, the tooltip would say Local ItemsSelected As ItemsSelected, or just ItemsSelected As ItemsSelected.The sample would give you that ability. The last snippet returns a msgbox with the constructed string. You can then split it and loop through it to populate the live form/report.Thanks, I understand, but the user sees the order in a live form/report
That doesn't mean anything Mike. It's like saying the Open occurs before Load.They differ in terms of when they occur. Exit occurs before LostFocus.
Private Sub lstStates_Enter()
Call LogEvent(Me, "lstStates_Enter")
End Sub
Private Sub lstStates_GotFocus()
Call LogEvent(Me, "lstStates_GotFocus")
End Sub
'''.....other events are between these
Private Sub lstStates_Exit(Cancel As Integer)
Call LogEvent(Me, "lstStates_Exit")
End Sub
Private Sub lstStates_LostFocus()
Call LogEvent(Me, "lstStates_LostFocus")
End Sub
The key part that you left out of my quote is that the exit event is cancelable. Makes sense to me. Taken out of context, yes I agree with you.That doesn't mean anything Mike. It's like saying the Open occurs before Load.
Every event is a "hook". There is a huge amount of code that runs behind the scenes of a form that makes it work. We can't see it and we can't change it. The original MS developers added "hooks" in their mainline code where they could let us hang our custom code to do certain things. Every hook has a specific purpose and is intended for certain types of "user" (that's us) code. For example, it makes no sense to put validation logic in the Current event of a record because that event runs before any data ever gets typed into a form.
The most useful documentation that MS could provide for events is what types of logic THEY intended the "hook" to handle. The events are not random. They each have a specific purpose but some are muddy.
So the following is the "bracketing". It is not clear to me why two sets of brackets are provided. I can sort of understand why the LostFocus doesn't have a cancel event. That would essentially leave you in never, never land between two events. But, OK, then why would you not put the hook for the GotFocus first and the Enter second? IF MS would give us actual, logical samples for what type of logic they envision for each of these events, developers would find that very useful.
Code:Private Sub lstStates_Enter() Call LogEvent(Me, "lstStates_Enter") End Sub Private Sub lstStates_GotFocus() Call LogEvent(Me, "lstStates_GotFocus") End Sub '''.....other events are between these Private Sub lstStates_Exit(Cancel As Integer) Call LogEvent(Me, "lstStates_Exit") End Sub Private Sub lstStates_LostFocus() Call LogEvent(Me, "lstStates_LostFocus") End Sub
This statement is really puzzling to me. If you can't see it, then how do you know there is a ton of code behind it? Maybe you worked for Microsoft, I don't know. Without seeing it though, I would reason that it is merely a hook as you say and there is not much code behind it at all. It's doesn't seem like there is much to it as all it has to do is consider which controls could get the focus in the case of On Lost Focus, or which controls can be exited from. We're talking about a couple of event hooks for a single listbox control. But if you look at all the controls that have an exit and a lost focus, they sure appear to do the exact same thing me. That's what classes do, right? Why would any programmer make a special Exit event for for every control, when you could just make one single exit hook for all controls that it applies to. Isn't that the whole idea of a class? Sure wish we had a Microsoft insider that could verify all of this sort of stuff.Every event is a "hook". There is a huge amount of code that runs behind the scenes of a form that makes it work. We can't see it and we can't change it.
Access source code is not public, so nobody here can possibly know that without having worked directly with it. And if someone did I have a bunch of questions that need answers.Why would any programmer make a special Exit event for for every control, when you could just make one single exit hook for all controls that it applies to
Let's assume that the Exit event would be included in the Control interface and that all other controls would inherit from the ControlClass.Why would any programmer make a special Exit event for for every control, when you could just make one single exit hook for all controls that it applies to. Isn't that the whole idea of a class?