Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / October 2005

Tip: Looking for answers? Try searching our database.

Subform to Form -- SetFocus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joy M - 31 Oct 2005 18:27 GMT
Hi -

Is it possible (given that I am in a subform) to use VBA to set focus to a
command button on the form (that contains the subform)?

Thank you for your help,

Joy
RuralGuy - 31 Oct 2005 20:25 GMT
Certainly!  Me.Parent.cmdButtonName.SetFocus

Using your cmbButtonName of course.

>Hi -
>
[quoted text clipped - 4 lines]
>
>Joy

_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
Ofer - 31 Oct 2005 20:51 GMT
And please ignore the buttom part of my post, its not relevant to you
Signature

This one - >
(If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.)

Good luck

> Hi -
>
[quoted text clipped - 4 lines]
>
> Joy
Ofer - 31 Oct 2005 20:51 GMT
Try
Me.Parent.[CommandButtonname].SetFocus
Or
Forms![MainFormName]![CommandButtonname]
Signature

If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck

> Hi -
>
[quoted text clipped - 4 lines]
>
> Joy
Ofer - 31 Oct 2005 20:57 GMT
I missed the setfocus in the second option
Forms![MainFormName]![CommandButtonname].Setfocus
Signature

If I answered your question, please mark it as an answer. That way, it will
stay saved for a longer time, so other can benifit from it.

Good luck

> Hi -
>
[quoted text clipped - 4 lines]
>
> Joy
Joy M - 01 Nov 2005 00:05 GMT
Hi -

Thanks for your quick responses.  They worked fine.

I was using a period instead of  an exclamation mark in mine.
I.e., I had Forms.[MainFormName].[CommandButtonname].Setfocus but it didn't
work

How do you decide when to use ! and when to use a period in this syntax?

Thanks again,

Joy
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.