Kickoff Press of Navigation Button from VBA Form Open

Bluecider

New Member
Joined
Feb 11, 2017
Messages
12
Hi, I'm doing mad (as usual), as I don't think this should be so hard, but for some reason it is...

On the Form Open event of a form, I want to have it so one of the Navigation Buttons is pressed automatically via VBA, as if the user themselves were using a mouse to click the navigation control.

Navigation Button name is: BY_RECRUITER_T

Sub Form_Open(Cancel as Integer)
Debug.Print Controls("BY_RECRUITER_T").Enabled
End Sub

The above doesn't yield any error but also does nothing.

I suppose I'm way off here. Tried putting this in Form_Activate and Form_Load as well to no avail.

Could someone slap me across the head with a HOMER "DUH" and tell me how to do this?

Really much thanks in advance.. *sigh*
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I'm not familiar with navigation buttons (maybe a control a haven't used before) but probably instead of thinking about "clicking the button" you want to think about doing what the button does. For instance, if it takes you to the first record then you want to go to the first record.
 
Upvote 0
I would think it'd be just like a control maybe. It's an element that I think should have the ability to address and kick off a click of that element.

This is a navigation control that doesn't have any clear code attached to it's click event. So I I just wanted it to be clicked on form open.
But maybe the object needs to be rendered first before any kickoff to make the element 'clicked' can happen.
So an AFTER Form load event?
 
Upvote 0
I don't know if by navigation control you just mean the arrows (forward/back) at the bottom of the form or something in Access that I'm not familiar with. What are you trying to navigate to?
 
Upvote 0
This did it:

Forms![frm_MAIN].NavigationSubform.SourceObject = "frm_JOBS_LIST"

Just added that. It's about controlling what is shown in the Navigation Subform.
 
Upvote 0
Okay. Yeah, I've never used those. New in 2000-something (after Access 2007).
 
Upvote 0

Forum statistics

Threads
1,215,064
Messages
6,122,936
Members
449,094
Latest member
teemeren

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top