Beffudled....Please Help With Tab Caption

Jul 10, 2005

Background:

I am trying to write a Macro which will change the Caption of Several Tab Control Pages, based on entries in a Table.

Here is the entire three step macro:

Open Form
Form Name: Draft
View: Design
Filter Name: <none>
Where Condition: <none>
Data Mode: Edit
Window Mode: Normal
SetValue
Item: [Forms]![Draft]![TabCtl32].[Pages](1).[Caption]
Expression: =DLookUp("[BFL Team]","BFL Teams","[ID] = 8")
Close
Object Type: Form
Object Name: Draft
Save: Yes

All Appears OK, except I get two different results, depending on what I try to name the Tab Caption.

If the Value in the "BFL Teams" Table pointed to by the DLookUp Statement is a number (Like 1234), all is well, the Macro Executes as expected, and the Tab Caption is updated to 1234.

What is madening is that I want to use an alphanumeric name. When I try to use anything other than Numbers, (Lets use 'Text' as an example) the Macro Barfs on the second statement with the message:

"Microsoft Access can't find the name "Text" you entered in the expression"



I am using Access 97, if that helps. The entire Database is automated using only Macros (No Modules).

This is my Fantasy Football League Draft Software that I have developed over the past several years. I am by no means an Access Ace, I just got this thing to work through trial and (lots of) error, for the most part.

What I am trying to do is to automate the changes I have to make every year, and one of them is to handle changes of Team Names, and I have a Tab Control for each Team with the Team Name as the Caption.

I would just like to have the Captions on each Team Page to be updated from entries in the "BFL Teams" Table, as part of a Macro I would run to automatically set up the Tables, Forms and Reports each year, rather than make the Brute Force Changes on an anual basis.

I am sure that I am just doing something bone headed, but for the life of me, I am at a loss on how to proceed.

Thank you to anyone who takes the time to look into this.

View Replies


ADVERTISEMENT

Form's Caption

Jul 28, 2005

I have a form with a subform. The subform displays
records in datasheet format but is not linked to
the main form.

I am attempting to get the hightlighted record on the
subform to appear in the main form's caption bar. If I isolate
the subform then that subform caption shows the current
record on the datasheet. I can't get it to work on the main
form however.

On the main form's current event I have
Me.Caption = Me.Subform.Form.EmployeeID
The main form caption only shows the first record on the
subform.

Can anyone help me on this. I have searched everywhere
Regards

View 3 Replies View Related

Modules & VBA :: Using Caption Instead Of Name?

Apr 22, 2015

I'm trying to customise the error message for Input Mask Violations, so that it references the control where the error has occured, rather than just being a generic error message.

I can make this work using the code below:

Private Sub Form_Error(DataErr As Integer, Response As Integer)
Const INPUTMASK_VIOLATION = 2279
If DataErr = INPUTMASK_VIOLATION Then
MsgBox "Please check that the information you have added in the " + Screen.ActiveControl.Name + " field is in the appropriate format."
Response = acDataErrContinue
End If
End Sub

BUT, all my field names are shortened e.g. Mobile Number = MobileNo, so I want to use the caption property instead. I assumed I could just change it to "Screen.ActiveControl.Caption". But this doesn't work at all!

View 5 Replies View Related

Any Way To Get The Caption Text For A Field?

Aug 21, 2006

All,

I am trying to get the caption text for a field instead of the raw database name. The raw database name can be extracted using the Fields Collection:

Fields.Item(w).Name

Is there a way to retrieve the caption, as this makes more sense to the user?

For example, instead of the field name "numEmp", I want to retrieve "Number of Employees".

I need this because I am creating a form at runtime (on the fly).

Thanks,
Sal

View 5 Replies View Related

Caption On Navigation Bar In MSAccess

Apr 28, 2005

Is there a way to change the caption "Record" to "My Record" on navigation
bar in a MSAccess Form?

:rolleyes:
Thanks in advance.

View 4 Replies View Related

How To Determine The Label Caption

Aug 25, 2006

On a form I have multiple labels. In the Click event of all these labels I would like to call a generic function for futher processing. For this processing however, I need the caption of the label the user clicked on. How do I determine this caption?

View 2 Replies View Related

Form Caption Question

Sep 21, 2006

Dont know if its possible but no harm in asking.

Can the caption for a form be set to the value of a text box i.e. "Text10" for example?

cheers

View 11 Replies View Related

Command Button Caption Help

Oct 16, 2006

I have a caption that changes dynamically using VBA. How do I insert a carrige return between two strings which will make up the caption.

I appreciate any help.

View 2 Replies View Related

Control.caption Access97 To A2000

Jan 4, 2006

I am converitng a database with quite a bit of associated code from A97 to A2000. The following fails:

Dim ctlSample As Control

Set ctlSample = CreateControl(frm.Name, acLabel, acDetail, "", _
, sngLeft, sngTop, conWidthLabel, conHeight)

'set properties of the sample label

With ctlSample
.Caption = rst!SampAbrv


Is there a new syntax for ctl.caption in 2000? I've tried help and a web search but no joy.

Thanks,

Tiffany

View 11 Replies View Related

How To Query The Caption Of A Command Button

Jan 24, 2006

G'day all

I want to create a form that will be the layout of my storage warehouse. I actualy have a layout on paper but was thinking of doing it on a form for the users to have a better view. The location of the inside warehouse have 60 location or Bin. The outside one has 80 Bins.
This will need 2 query. 1 for the inside Bins and 1 for the outside Bins. They are both the same query except for the caption of each command button.

What will be the beast way to create the query as to the criteria is to read from thee caption of the command button.
If the caption is 50 then give me everything in 50.

Hope this make since.

Thanks you so much.
JP

View 2 Replies View Related

How To Show Total In Caption Of Window

Jul 22, 2005

Hi All.
I created form with unbound listboxs based on query which included Credit field that I want to calculate total and show result in caption of window. If is it possible how to do it?
Thanks.

View 1 Replies View Related

Caption Height In Datasheet View

Apr 28, 2006

I have a caption named original investment.

I want it to be displayed as

original
investment

at the column head not as

original investment

how do I do this?

thanks

View 3 Replies View Related

Forms :: Set Textbox As Form Tab Caption

Nov 27, 2013

I have a Form in which there is a textbox. I would like the name (caption) of the Form (that shows in the tab at the top of the form) to be named/updated to whatever is entered into the textbox.

View 9 Replies View Related

Forms :: Cmd Button Caption Not Displaying

May 30, 2013

I am building a form and part of the code is:

Code:
Private Sub Form_Load()
lblSalary.Caption = "Enter Salary"
txtSalary.Value = "5000.00"
cmdIncrease.Caption = "Increase Salary"
End Sub

The problem I am having is that I dont understand why the cmdIncrease button does not display "Increase Salary" when the form loads. The button is there but it is blank. The lblSalary button displays "Enter Salary" with no issues.... and I do not have "Enter Salary" in the caption property window... only in the coding window but it still works.

View 6 Replies View Related

Forms :: Copy Caption To Clipboard

Apr 15, 2014

I am trying to copy a caption from a form to the clipboard so that I can later paste it into another application.

The code I have found via a search on this website 1) Clears the clipboard and then 2) copies the caption from a nominated field. 2) doesn't work as I sure I have the statements wrong.

Call EmptyClipboard

Me.B7_DB_GCUH.Caption
DoCmd.RunCommand acCmdCopy

View 1 Replies View Related

Change Button Caption On Continuous Forms

Mar 10, 2006

I have a form, the view of which is continuous forms.
It has information on the left of the screen which the user is expected to manually match to information on the right, based on the suggestion of the underlying query (based on table a and table b)

E.g.

Client A $200 <button> Mr Smith $200.00
Client B $100 <button> Mr Smith $100.01

There is a button "match me" which when clicked runs an update query.

My query is how do I change the caption on the "match me" button to say "matched" just for the one that is clicked? Because it is a continuous form, if I use Command1.Caption = "Matched" or Me!Command1.Caption = "Matched" it changes it for all the buttons on the form.

Many thanks.

View 2 Replies View Related

Textbox Or Button Caption Showing Count

Sep 6, 2005

I'm trying to show a count of filtered records on a form. The Filter is number of days from the system date which I've already built into a query. I'm trying to get the record count for each day out up to the tenth day and show the counts on a form. Is this prossible? and how is it done?

View 2 Replies View Related

Indexed Objects In Forms EG Label1(1).caption

Mar 22, 2006

Hi Guys (second post in 11 minutes!),

In VB you can index objects, and create duplicates of them, like this...
Code:Load label1(1)label1(1).Caption = "This is a label" But to do it, you must first create the original object in Design view, and set it's Index property to a number (there is an Index field in the Properties window in VB). For examle, to do the above I would create a label called Label1(0) in design view.

However, I cannot find this Index Field in the Properties window in Access - can you even create arrays of objects?!?!

Cheers.

View 1 Replies View Related

Forms :: Tabbed Documents Icon On Caption Bar

May 25, 2015

Customizing the form with the following code

Code:

Public Declare Function LoadImage Lib "user32" _
Alias "LoadImageA" _
(ByVal hInst As Long, _
ByVal lpsz As String, _
ByVal un1 As Long, _
ByVal n1 As Long, _
ByVal n2 As Long, _
ByVal un2 As Long) _
As Long

[code]...

I can load the little icon on the left on CaptionBar.It works very well on overlapping mode but no on Tabbed documents. How to works with tabbed documents mode?

View 9 Replies View Related

Queries :: Dialog Box Caption - Enter Parameter Value

Dec 15, 2014

I have a query that I use a like statement. How do I change the Header to something beside "Enter Parameter Value"?

View 2 Replies View Related

Forms :: Change Form Icon Next To Caption?

Jun 12, 2014

how to change a form icon and make that icon embed to my database, I have tried the Application Icon property in Access Options but when I copy the database to other computer then the icon disappeared.

View 3 Replies View Related

Forms :: Set Caption Value For A Command Button At Run Time

Mar 12, 2015

Is there a way to get a string from a field and use it to set the caption value for a command button at run time?

View 2 Replies View Related

Loading Button Caption To Global Variable

Nov 13, 2013

I have a form with up to 100 buttons generated based on a number of conditions. I am trying to pass the caption of a button to a sub so that I can open the correct forms. When a button is clicked how can I read it's caption. Me.caption is reading the form caption.

View 7 Replies View Related

Create 3 Custom Caption Buttons For A Message Box?

Nov 18, 2013

Is it possible to create 3 custom caption buttons for a message box?

I know I could do this as a form, but would like to know if it can be done in vba using msgbox...

View 2 Replies View Related

Form In Datasheet Mode : Name Of Textbox Is Caption Of Column ???

May 5, 2006

My form is in datasheet mode.

One of the textbox is called txtHours

When I access the form the column caption is "txtHours" !

As you can expect it looks ugly.

So to get a decent caption like "Hours" I am forced to set my textbox name to "Hours" !

As you can expect it goes against my coding standard to do that.

Beside I want the caption of some textboxes to include some non-standard letters such as `é' è' '!' ' ' etc. and if I put those in the textbox name it ruins the visual basic code !

View 2 Replies View Related

Audit Trail To Read The Caption Of The Field From The Table

Dec 20, 2006

Hi every one

i have an application with an audit trail module, i do read the table name , field name,old value, new value. but the lables of the fields at my forms are changed to arabic language

for example

lets say i do have a table
the name of one field is Name
on the form the label of this field is Lawyer Name

now the client is asking me to show the ( Lawyer Name ) not the field name ( Name ) in the audit trail to know the changes were made.

I thought to go to the tables and on each field 's caption i shall add in arabic the same as in my form

I am trying to read the caption of the field from the tables

i hope you understood what i mean

if you show me the code to do that , it would be highly appreciated

thanks in advance

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved