Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create option group in vba - reuse on all forms 3

Status
Not open for further replies.

belovedcej

Programmer
Nov 16, 2005
358
US
Right now I have numerous forms and in the header of each are navigation buttons to take the user to any of the other forms (or exit the application). But that means I have to go to every form to make any changes - even if it's just to the size of the buttons. And of course, it is difficult to get the header to look the same on every form. Somehow, I KNOW there's a better way. :)

My thought - create an option group object in vba and then in the on open even of each form instantiate that object and place it in the header of the form. Although I use VBA, I have never tried to actually create an entire object using it.

Is this possible? Is there a better way?
 
A simple way would be to create a 'navigation' form that could be included as a subform in each form.
 
Or maybe a custom CommandBar ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OR create a custom toolbar and or menu bar which could be attached to all forms.
 
Thanks for the tips - a toolbar looks ideal - I should have thought of that before and will certainly make note of that for future projects.

However, for this project the subform option might be the only option. The users want the big clunky buttons, cluttered as that is. :)

I'm still going to try to find out how to do this through a custom object, though, because I believe the knowledge down the road will be very valuable for other things.
 
Okay - further question on this. I'm using the subform option and have created a form with all desired buttons and vba.

On the on load or on open event of each form, I want to hide (or disable, either one) the button that would open that particular form.

I have referred to it in this way:
Code:
Me.txtClaimNumber.SetFocus
Me!NavigationPanel.Form!cmdOpenClaims.Visible = False

However, I keep getting the message that you can't hid the control that has the focus.
 
You need to move the focus within the subform.

As a ps, when I did a similar thing, I used labels.
Code:
Private Sub lblCmdNext_Click()
    If lblCmdNext.ForeColor = conDullBlue Then
        Exit Sub
    End If
    DoCmd.GoToRecord , , acNext
End Sub

Private Sub lblCmdNext_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If lblCmdNext.ForeColor = conDullBlue Then
        Exit Sub
    End If
    ChangeMouseToHand
End Sub
 
Perfect!! I should have thought about the subform focus. :)

Thanks so much.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top