A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

OnGotFocus on a popup form



 
 
Thread Tools Display Modes
  #1  
Old October 19th, 2005, 08:53 PM
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

i am trying to trigger some code to run when a popup form gets focus or
is activated. the trouble is these 2 events do NOT trigger (access
'disables' them) when a form's Popup property is Yes.

any ideas?

  #2  
Old October 19th, 2005, 09:39 PM
Klatuu
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

It has nothing to do with the form being a popup. Here is text copied
directly from Help:
A form can receive the focus only if it has no controls or if all visible
controls are disabled. If a form contains any visible, enabled controls, the
GotFocus event for the form doesn't occur.
And:
The Activate event doesn't occur when a form receives focus back from a
dialog box, popup, or another form.



" wrote:

i am trying to trigger some code to run when a popup form gets focus or
is activated. the trouble is these 2 events do NOT trigger (access
'disables' them) when a form's Popup property is Yes.

any ideas?


  #3  
Old October 19th, 2005, 10:19 PM
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

thanks for the reply.

more simply put, how do i trigger code when i move back to my form that
happens to have the Popup property set to Yes.

  #4  
Old October 19th, 2005, 10:49 PM
Klatuu
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

You are correct about the Popup blocking the Activate event. I tried a few
tricks, but I can't make it run any code for the form.
I'm sure there is a way, maybe someone else might know a trick to get around
this problem.
One question, what is it you want to do when the focus goes back to the
popup? Do you also want to do the same thing the first time the form is
opened?

" wrote:

thanks for the reply.

more simply put, how do i trigger code when i move back to my form that
happens to have the Popup property set to Yes.


  #5  
Old October 19th, 2005, 11:06 PM
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

i have a bunch of combo boxes that i want to requery. i have a bite of
code that cycles thru them and requeries them. i want to run it each
time i activate the form.

if i turn off the Popup, it works fine....as you discovered.

  #6  
Old October 19th, 2005, 11:21 PM
Klatuu
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

Aha! I think this will work. I tried a little test, but it may not work like
you want it to. In the form that opens the popup, I open the form with a
command button, then manipulate some controls on the popup in the click event
of the calling form:
DoCmd.OpenForm "ztester"
Forms!ztester!Text9 = Forms!ztester!Text9 + 1

Each time I click the command button on the calling form, the value
increments as expected; however, just moving from form to form doesn't do it.

I don't know of anything else to try.

" wrote:

i have a bunch of combo boxes that i want to requery. i have a bite of
code that cycles thru them and requeries them. i want to run it each
time i activate the form.

if i turn off the Popup, it works fine....as you discovered.


  #7  
Old October 19th, 2005, 11:25 PM
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

thanks for trying. i may just add a 'Refresh' button until i the magic
bullet happens to whiz by my head. (i am a fan of automation whereever
feasible...and this seems feasible).

  #8  
Old November 22nd, 2005, 03:15 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default OnGotFocus on a popup form

Hi Aaron,
I am running into a similar problem that you described in this thread. I
have a form with a grid containing recs on it. When a user selects a record
in this grid a maint form appears so they can edit the record. This maint
form has the properties popup = y, modal = n because I want them to be able
to move the maint screen around and see the recs in the grid in the form
underneath, and maybe interact with it while maint screen up (i.e. resort
recs in grid). In any case, once they update the rec in the maint form, the
user is brought back to the form with the grid in it but I can't figure out
how to refresh the recs in the grid with the newly updated data (the activate
event does not get executed). I've tried everything I could think of but my
only solution is to do what you suggested - add a refresh button. I was
wondering if the magic bullet happened to whiz by your head so you could
share some great solution to this problem. Any info is greatly appreciated.
Jackie


" wrote:

thanks for trying. i may just add a 'Refresh' button until i the magic
bullet happens to whiz by my head. (i am a fan of automation whereever
feasible...and this seems feasible).


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Focus return to textbox on main form after opening popup Steven Using Forms 1 August 10th, 2005 08:36 PM
Combo Box NotInList - How To Add Data To Underlying Table 10SNUT Using Forms 19 July 8th, 2005 09:12 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 05:11 AM
Need query to separate 2 entry types in a table field Jan Il Running & Setting Up Queries 31 November 23rd, 2004 06:57 PM
How to setfocus to Popup form? Bam Bam General Discussion 1 June 22nd, 2004 06:04 AM


All times are GMT +1. The time now is 08:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.