Link to home
Start Free TrialLog in
Avatar of Karen Schaefer
Karen SchaeferFlag for United States of America

asked on

type Mismatch on text and function concatenation

I am try to create the form caption on the fly,  it works on 1 form by not on another,

What am I missing?

Private Sub Form_Load()

   On Error GoTo Form_Load_Error

    Me.lblCaption_start.Caption = "CompanyName" & Year(Date) & " CONTRACT YEAR"
   
   On Error GoTo 0
   Exit Sub

Form_Load_Error:

    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure Form_Load of VBA Document Form_frmPassword"
End Sub

Open in new window

Avatar of Gozreh
Gozreh
Flag of United States of America image

is the "lblCaption_start" a Label Field ?
do you have a field on this form called "Date" ? you should type Date()
SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also ... is CompanyName  supposed to be a Variable ?

Because as is the Caption is going to look like this:

CompanyName 2014 CONTRACT YEAR

?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Karen Schaefer

ASKER

THANKS FOR THE INPUT
"you need to set the Text property of the form:"

Karen ... there is no such property 'text' of a Form.  So, I'm confused as to why 250 pts was assigned to this post ?

mmx
sorry the points where suppose to be spread equally for time and effort.

K