Go Back   Access World Forums > Microsoft Access Discussion > Macros

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-03-2019, 08:09 AM   #1
accessingaccess
Newly Registered User
 
Join Date: Mar 2019
Posts: 11
Thanks: 7
Thanked 0 Times in 0 Posts
accessingaccess is on a distinguished road
Macro to open form to a sepcific tab?

Hi!


I have a form with three tabs. When I open this form in add mode, I would like it to default to a specific tab. I was hoping to achieve this with a macro. Is this possible? I can't figure it out...


I'm using Access 2016.


Thank you!

accessingaccess is offline   Reply With Quote
Old 06-03-2019, 08:19 AM   #2
theDBguy
Iím here to help
 
theDBguy's Avatar
 
Join Date: Oct 2018
Location: SunnySandyEggo
Posts: 3,556
Thanks: 38
Thanked 869 Times in 852 Posts
theDBguy will become famous soon enough theDBguy will become famous soon enough
Re: Macro to open form to a sepcific tab?

Hi. I don't use macros much but try something like:
Code:
If [NewRecord]
  Set Property
    ControlName: TabControlName
    Property: Value
    Value: 2
Change 2 to which ever tab you want to assign. You may also have to start with zero (0).
__________________
Just my 2 cents...

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
theDBguy is offline   Reply With Quote
Old 06-03-2019, 09:45 AM   #3
Micron
Newly Registered User
 
Join Date: Oct 2018
Location: Ontario, Canada
Posts: 797
Thanks: 10
Thanked 161 Times in 155 Posts
Micron will become famous soon enough Micron will become famous soon enough
Re: Macro to open form to a sepcific tab?

You could simply set focus to a control on the page and that page will be the active one when form opens. Probably doable wit a macro (I don't use them either so just guessing) but code would look like
Code:
Private Sub Form_Open(Cancel As Integer)

Me.NameOfControlHere.SetFocus

 End Sub
EDIT - forgot to mention that I didn't include a test for new record because how form is being opened wasn't specified. Could be OpenArgs or even a duplicate of a form that's just for editing or appending records (which isn't the best method) or some other undisclosed method.

__________________
Sometimes I just roll my eyes out loud...
Windows 10; Office 365 (Access 2016)
Micron is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to open form access2010 Macros 1 09-29-2014 02:06 AM
Need a Open Form Macro fenhow Macros 1 07-13-2005 08:16 AM
Open form with macro NVAlice Macros 4 06-30-2005 01:13 PM
Macro To Open Form pam_w_85 Macros 2 04-10-2005 02:00 PM
selecting sepcific record in report ymalcolm Reports 1 01-02-2002 03:09 PM




All times are GMT -8. The time now is 06:10 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World