[AccessD] get focus back to subform - URGENT

Kath Pelletti kp at sdsonline.net
Mon Jul 14 18:11:06 CDT 2008


Bit of a long story.   I kept getting error 7878 - "data has changed". That 
was because I had a field (dateUpdated) which was updated by code on both 
the subform and the main form. When I was debugging i found an article 
suggesting that Me.parent.requery was the best way around that error. So I 
added it to the control's after update event and then hit the problem of not 
being able to get the focus back.

After a bit of a re-design I ended up keeping the Me.Parent.Requery - but I 
moved it to the subform's after update event instead of the control's after 
update event. It works.
Kath

----- Original Message ----- 
From: "Charlotte Foust" <cfoust at infostatsystems.com>
To: "Access Developers discussion and problem solving" 
<accessd at databaseadvisors.com>
Sent: Tuesday, July 15, 2008 1:26 AM
Subject: Re: [AccessD] get focus back to subform - URGENT


> Kath,
>
> Me.Parent.Requery is the problem, and I don't understand why you want to
> use it.  When you requery the parent, you requery everything, so the
> "next" control is meaningless anyhow.
>
> Charlotte Foust
>
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath Pelletti
> Sent: Sunday, July 13, 2008 4:50 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] get focus back to subform - URGENT
>
> Thanks Darren
>
> ----- Original Message -----
> From: "Darren D" <darren at activebilling.com.au>
> To: "'Access Developers discussion and problem solving'"
> <accessd at databaseadvisors.com>
> Sent: Thursday, July 10, 2008 2:11 PM
> Subject: Re: [AccessD] get focus back to subform - URGENT
>
>
>> Hi Kath
>>
>> Be explicit then - Something like
>>
>> ...Some Code
>> me.parent.requery
>> 'Then
>> Forms!frmSomeMainForm.form.somesubform.somesubformcontrol.setfocus
>> ...some code
>>
>> Re your earlier post about moving between controls
>> I assume you want the user to just tab away happily and move between
> the
>> subform and the main form without really knowing or seeing any
> difference
>>
>> I do this explicitly too - I determine the 'last' control on the main
> form
>> then on the 'lostfocus' of that field I have something like
>> Forms!frmSomeMainForm.form.somesubform.somesubformcontrol.setfocus
>> And the reverse on the last control on the sub form
>>
>> There are probably better ways to do this but this is simple and it
> works
>> for end user navigation well enough
>>
>> See ya
>>
>> DD
>>
>> -----Original Message-----
>> From: accessd-bounces at databaseadvisors.com
>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Kath
> Pelletti
>> Sent: Friday, 11 July 2008 1:52 PM
>> To: Access D Normal List
>> Subject: [AccessD] get focus back to subform - URGENT
>>
>> Must be a bad day....
>>
>>>From a control on a subform, when I say
>> me.parent.requery,
>>
>> I then cannot get the focus back to my control on the subform using:
>>
>> me.controlname.setfocus.
>>
>> Any tips? This should be easy stuff but driving  me mad today.........
>> tia
>>
>> Kath
>> ______________________________________
>> Kath Pelletti
>> -- 
>> 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
> 





More information about the AccessD mailing list