name of tab control (1 Viewer)

poppy_123

New member
Local time
Yesterday, 22:39
Joined
Jul 27, 2013
Messages
2
Hello guys, I have made a tab control in my form and I want to keep the name of my first tab as CA&OP but when I set the caption property of my first tab as CA&OP it shows as CAOP. How I can show it as CA&OP.
Thanks for response
 

nanscombe

Registered User.
Local time
Today, 06:39
Joined
Nov 12, 2011
Messages
1,082
You need to double up the ampersand ... CA&&OP because Access uses a single ampersand to denote a hot (shortcut) key, the underlined letter.
 

highandwild

Registered User.
Local time
Today, 06:39
Joined
Oct 30, 2009
Messages
435
The & character is used to concatenate two values and that is just what it has done. I would use the word 'and' if you really need to represent the name like this and get on with more tricky things.

Page names cannot be changed in VBA so the option to used the ASCII character 38 is not available.

Object names cannot be calculated in an expression so that option is also not available.
 

highandwild

Registered User.
Local time
Today, 06:39
Joined
Oct 30, 2009
Messages
435
I've learnt something new there so thanks Nanscombe.

I'm not sure when I'll need it though!!

I do dislike the Tab Control.
 

nanscombe

Registered User.
Local time
Today, 06:39
Joined
Nov 12, 2011
Messages
1,082
ACC: Allowing an Ampersand to Appear in a Caption

Microsoft Access allows you to underline a character in a caption, giving it ALT key access, by specifying an ampersand before the character that is to be underlined. Because the ampersand appears before the space in the following caption

Jack & Jill



Microsoft Access assumes that the intention is to underline the space following the ampersand.

If an ampersand is to appear in a caption, you must specify two ampersand characters in a row. For example, entering the following caption in the property sheet

Jack && Jill



will result in the following caption in the resulting form or control:

Jack & Jill
 

nanscombe

Registered User.
Local time
Today, 06:39
Joined
Nov 12, 2011
Messages
1,082
I do dislike the Tab Control.

I actually like them, especially in conjuction with sub forms. :)

You can load up a tab with multiple tab controls but you can delay loading the data until each tab is first clicked at which time you define the sub form.

This can be quite useful if you have a lot of data, in different tables, which takes a long while to load when a form is first opened.

It's also useful as a login screen (see attached example). First tab is visible, the rest not, until the correct password is entered. You can then make other tabs visible as required.
 

Attachments

  • highandwild_002.zip
    15.1 KB · Views: 150
Last edited:

emsadoon

Registered User.
Local time
Today, 02:39
Joined
Jun 6, 2013
Messages
83
Thanks Nigel. I am actually using your way to create one for myself. But, I do not know how to call my navigation buttons.I have navigation buttons with names of NavigationButton1,NavigationButton2,.... . Furthermore, each of this navigation button targets to an existing form outside the navigation form. I cannot find something like "maintab" in my navigation form. Here is my code:

Code:
Private Sub cmdLogin_Click()
Dim intPages As Integer

For intPages = 1 To Me.NavigationButton.Pages.Count - 1
    Me.NavigationButton.Pages(intPages).Visible = (Me.txtPassword & vbNullString = "abc")
Next intPages

If Me.NavigationButton.Pages(1).Visible Then Me.NavigationButton = 1
End Sub
 

Users who are viewing this thread

Top Bottom