Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Focusing Nuts!

Status
Not open for further replies.

Telsa

Programmer
Jun 20, 2000
393
US
Why would this

Me.Base.SetFocus

jump to this procedure??

Private Sub PartNo_LostFocus()

Makes no sense to me!

Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Two questions...
1) what are you doing with the me.base.setfocus statement?
I don't understand the Base property. what version of MS access are you using?

2) Does the control with name PartNo have focus when you run the above code? If so, it is losing focus when you move the focus to wherever its going. Jonathan
________________________________________
It is not fair to ask of others what you are unwilling to do yourself.
-Eleanor Roosevelt
 
if you are in part_no method when you do this it inherantly loses focus and that would call hte lost_focus method.

Brian :)
 
Base is a field on the form. I first focus on it to capture the data to cut it down to size.

Then there are several lines of code it goes through.

It was working fine until I tried to add code to a different procedure for PartNo_LostFocus. I was doing a step process to watch it and it jumps right after that Me.Base.Setfocus line. So weird!

Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Nevermind... I ran a compact and repair and seems to be working now. That was so weird. Now if I can only get my PartNo_LostFocus to run. Seems to get ignored. Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Wrong again... that didn't make any difference. Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
As already noted, you need to review/understand the event sequence. When you do "set focus", SOMETHING already has the FOCUS. You need to "get out" of 'there' before you can go anywhere else. Hence "LOST_FOCUS" from SOMEWHERE. In this case, is is/was (obviously?) PartNo?

Dont feel to bad. WHOLE books (and NOT small ones) have been devoted to the event driven process.


MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
OKay, I see it. I understand the behavior and fortunately, it's not harming anything, yet.

Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Well,

i 'HOPE' it doesn't "HARM" anthing for a while, because it (the functionality) is not going to change in the foressable future.;-)
MichaelRed
redmsp@erols.com

There is never time to do it right but there is always time to do it over
 
By changing the event from LostFocus to AfterUpdate, it seems to work one time until I save it. Then when I try testing again (new record and all), it doesn't work anymore.

My intent is to capture data in two variables and then if my blnUpdate variable is True, run a SQL statement using those two variables after an update has happened. Mary :)

Rule 1: Don't sweat the small stuff.
Rule 2: EVERYTHING is small stuff!! X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top