[AccessD] Tabbing to Another control

Edward S Zuris edzedz at comcast.net
Sun May 18 23:21:01 CDT 2008


 These also work. . .

    [Forms]![frmMain1].SubForm.Form.RecordSource = sSQL
    [Forms]![frmMain1].SubForm.Form.Requery
    [Forms]![frmMain1].SubForm.Form.Refresh
    [Forms]![frmMain1].SubForm("cmdOKButton").SetFocus

 - or -

    [Forms]![frmDataView].SubFind.Form.cmdGetID.SetFocus

 Please note the second word .Form. doesn't have an "S".


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Steve Schapel
miscellany at mvps.org
Sent: Sunday, May 18, 2008 7:36 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Tabbing to Another control


Hi David,

Basically, whether a control is on a tab control or not is irrelevant.

Without testing, I'm pretty sure this will do it:

Me.Parent.sfrClientInvestment.Form!cboInvestmentType.SetFocus

Regards
Steve


David Emerson wrote:
> I have a form called frmClient.
> On it is a tab called tabClient.
> On tabClient is a subform called sfrClientRevision
> On sfrClientRevision is a tab called tabRevision with two pages -
> pgeSaving and pgeBudget
>
> On pgeSaving is a subform called sfrClientInvestment
> On sfrClientInvestment is a field called cboInvestmentType
>
> On pgeBudget is a subform called sfrClientBudget
> On sfrClientBudget is a tab called tabCashFlow
> On tabCashFlow is a page called pgeSummary
> On pgeSummary is a field called txtpgeSummaryLast
>
> What I would like to do is this: When txtpgeSummaryLast is tabbed
> into, then the focus automatically moves to cboInvestmentType.
>
> What I have tried on the OnEnter event of txtpgeSummaryLast is this:
>
>      DoCmd.GoToControl "sfrClientRevision"
>      DoCmd.GoToControl "tabRevision"     <-- Error here
>      DoCmd.GoToPage "pgeSaving"
>      DoCmd.GoToControl "sfrClientInvestment"
>      DoCmd.GoToControl "cboInvestmentType"
>
> The error message I get is No 2109: There is no field named
> "tabRevision" in the current record.
>
> I have also tried:
>
>      Forms!frmClient.SetFocus
>      Forms!frmClient!sfrClientRevision.SetFocus
>      Forms!frmClient!sfrClientRevision.Forms!sfrClientInvestment.SetFocus
> <-- Error here
>
> The error message I get is No 438: Object doesn't support this
> property or method.
>
> How can I get from txtpgeSummaryLast to cboInvestmentType?
>
--
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