[AccessD] Lose Focus

John B. john at winhaven.net
Wed Sep 17 15:59:01 CDT 2003


Mark,

My dilema is this:
I have a combo box on a continuos subform on a tab control page.
Once a user enters a new row on the continuous form they can (rarely) right
click and choose a menu item.
The menu item fires of a function which requires that the new record be
saved.
I can, of course save this record in the After_Update event of the combo box
BUT
1. this sequence of events is rare
2. saving the record normally wouldn't be desirable because of various
reasons

What I want to do is have the function which is called from the custom
shortcut menu save the new record which has been added previous to the
"right click".

Thanks,
John

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Mark A Matte
> Sent: Wednesday, September 17, 2003 3:02 PM
> To: accessd at databaseadvisors.com
> Subject: RE: [AccessD] Lose Focus
>
>
> John,
>
> If I understand your dilema...you need to reference the form name
> that had
> focus right before 'right clicking'...you might be able to use the method
> below.  The main error not addressed is if no control had focus
> previous to
> the 'right click'.  I created this function in a module(and can call from
> anywhere in app) and then referenced it on the shortcut menu.
> "ctlPrevious.Parent.Name" gives you the name of the form that you right
> clicked on...or the form name of the object(textbox or whatever)
> you right
> clicked on depending where you indicated it as a shortcut menu..
>
> Hope it helps,
>
> Mark A. Matte
>
> Function FormNameGet()
>
> Dim ctlPrevious As Control
>
>     Set ctlPrevious = Screen.PreviousControl
>     Forms!frmtest!test = ctlPrevious.Parent.Name
>
> End Function
>
>
>
> >From: "John B." <john at winhaven.net>
> >Reply-To: Access Developers discussion and problem
> >solving<accessd at databaseadvisors.com>
> >To: "Access Developers discussion and problem
> >solving"<accessd at databaseadvisors.com>
> >Subject: RE: [AccessD] Lose Focus
> >Date: Wed, 17 Sep 2003 10:47:51 -0500
> >
> >A custom shortcut menu.
> >
> >You were right :o)
> >
> > > -----Original Message-----
> > > From: accessd-bounces at databaseadvisors.com
> > > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Charlotte
> > > Foust
> > > Sent: Wednesday, September 17, 2003 10:23 AM
> > > To: Access Developers discussion and problem solving
> > > Subject: RE: [AccessD] Lose Focus
> > >
> > >
> > > John,
> > >
> > > Is this a custom shortcut menu or the built in context menu for the
> > > form/subform?  I assumed you were using a custom shortcut menu.
> > >
> > > Charlotte Foust
> > >
> > > -----Original Message-----
> > > From: John B. [mailto:john at winhaven.net]
> > > Sent: Tuesday, September 16, 2003 9:00 AM
> > > To: Access Developers discussion and problem solving
> > > Subject: RE: [AccessD] Lose Focus
> > >
> > >
> > > I've been reading up on this and ADH recommends not using ActiveForm.
> > >
> > > Maybe I'm overthinking this and missing something obvious but I'm
> > > definitely missing something :o)
> > >
> > > Can someone tell me how to save the record of the calling form when I
> > > can't pass the Me object to the function because it's being
> called from
> > > a shortcut menu?
> > >
> > > > -----Original Message-----
> > > > From: accessd-bounces at databaseadvisors.com
> > > > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John B.
> > > > Sent: Monday, September 15, 2003 5:41 PM
> > > > To: Access Developers discussion and problem solving
> > > > Subject: RE: [AccessD] Lose Focus
> > > >
> > > >
> > > > Charlotte:
> > > > That's what I'm experiencing. I have a function that is called by
> > > > shortcut menu from a number of different forms. The record
> needs to be
> > >
> > > > saved before it will work correctly. I could save the record
> > > > automatically in the after_update event but this would be saving the
> > > > record after each update for something that rarely occurrs.
> > > >
> > > > The only time this is an issue is if someone adds a new row
> (this is a
> > >
> > > > continuos form) and then uses the shortcut function immediately. Of
> > > > course a client just called and noted this. Click on
> another row first
> > >
> > > > is the immediate work around but not real obvious to them.
> > > >
> > > > I'm thinking I should be able to use ActiveForm to perform a
> > > > SaveRecord when the shortcut menu calls the function. Any
> help on that
> > >
> > > > idea would be welcome.
> > > >
> > > > John B.
> > > >
> > > > > -----Original Message-----
> > > > > From: accessd-bounces at databaseadvisors.com
> > > > > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of
> Charlotte
> > > > > Foust
> > > > > Sent: Monday, September 15, 2003 5:30 PM
> > > > > To: Access Developers discussion and problem solving
> > > > > Subject: RE: [AccessD] Lose Focus
> > > > >
> > > > >
> > > > > Sort of.  The exit event of the form doesn't occur, so
> context menu
> > > > > won't automatically trigger a save of the current record.
> > > > >
> > > > > Charlotte Foust
> > > > >
> > > > > -----Original Message-----
> > > > > From: Drew Wutka [mailto:DWUTKA at marlow.com]
> > > > > Sent: Monday, September 15, 2003 2:12 PM
> > > > > To: 'Access Developers discussion and problem solving'
> > > > > Subject: RE: [AccessD] Lose Focus
> > > > >
> > > > >
> > > > > It should because the popup menu would have the focus.
> > > > >
> > > > > Drew
> > > > >
> > > > > -----Original Message-----
> > > > > From: John B. [mailto:john at winhaven.net]
> > > > > Sent: Monday, September 15, 2003 4:57 PM
> > > > > To: AccessD
> > > > > Subject: [AccessD] Lose Focus
> > > > >
> > > > >
> > > > > Does the Lose Focus event fire when then shortcut menu is
> popped up?
> > > > >
> > > > > John B.
> > > > >
> > > > > _______________________________________________
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > > _______________________________________________
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > > _______________________________________________
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > >
> > > > >
> > > >
> > > >
> > > > _______________________________________________
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > > Website: http://www.databaseadvisors.com
> > > >
> > > >
> > >
> > >
> > > _______________________________________________
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > > _______________________________________________
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> > >
> >
> >_______________________________________________
> >AccessD mailing list
> >AccessD at databaseadvisors.com
> >http://databaseadvisors.com/mailman/listinfo/accessd
> >Website: http://www.databaseadvisors.com
>
> _________________________________________________________________
> Send and receive larger attachments with Hotmail Extra Storage.
> http://join.msn.com/?PAGE=features/es
>
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>




More information about the AccessD mailing list