Control Source, literal added

  • Thread starter Thread starter Chrissy
  • Start date Start date
C

Chrissy

Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I want to
left justify and follow with a colon. Presently, I am right justified and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find such
information?

Thanks so much.
 
If I understand your question correctly, if the current Control Source is
[MonthYear], change it to this:
=[MonthYear] & ":"
 
Instead of putting the field name as the ControlSource, put

=[FieldName] & ":"

Make sure that the name of the control isn't the same as the name of the
field: it'll set up a circular reference otherwise.
 
You did....and this works! Who knew? Not me...too simple. Thanks so much.
--
Chrissy


BruceM said:
If I understand your question correctly, if the current Control Source is
[MonthYear], change it to this:
=[MonthYear] & ":"

Chrissy said:
Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I want
to
left justify and follow with a colon. Presently, I am right justified
and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find
such
information?

Thanks so much.
 
Oops! Spoke too soon. It worked on a Count(*) control.

When I enter the control name it is ignoring my format of mmmm yy.
If I enter the control source I get error.

Did I miss something?

Control name is [txtSinceDate]
Source is =[SinceDate] & ":"

--
Chrissy


Douglas J. Steele said:
Instead of putting the field name as the ControlSource, put

=[FieldName] & ":"

Make sure that the name of the control isn't the same as the name of the
field: it'll set up a circular reference otherwise.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Chrissy said:
Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I want
to
left justify and follow with a colon. Presently, I am right justified
and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find
such
information?

Thanks so much.
 
=Format([SinceDate],"mmmm yy") & ":"

Not exactly sure what you mean by "enter the control source".

Chrissy said:
Oops! Spoke too soon. It worked on a Count(*) control.

When I enter the control name it is ignoring my format of mmmm yy.
If I enter the control source I get error.

Did I miss something?

Control name is [txtSinceDate]
Source is =[SinceDate] & ":"

--
Chrissy


Douglas J. Steele said:
Instead of putting the field name as the ControlSource, put

=[FieldName] & ":"

Make sure that the name of the control isn't the same as the name of the
field: it'll set up a circular reference otherwise.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Chrissy said:
Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I
want
to
left justify and follow with a colon. Presently, I am right justified
and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find
such
information?

Thanks so much.
 
=Format([SinceDate], "mmmm yy") & ":"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Chrissy said:
Oops! Spoke too soon. It worked on a Count(*) control.

When I enter the control name it is ignoring my format of mmmm yy.
If I enter the control source I get error.

Did I miss something?

Control name is [txtSinceDate]
Source is =[SinceDate] & ":"

--
Chrissy


Douglas J. Steele said:
Instead of putting the field name as the ControlSource, put

=[FieldName] & ":"

Make sure that the name of the control isn't the same as the name of the
field: it'll set up a circular reference otherwise.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Chrissy said:
Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I
want
to
left justify and follow with a colon. Presently, I am right justified
and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find
such
information?

Thanks so much.
 
Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I want to
left justify and follow with a colon. Presently, I am right justified and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find such
information?

Thanks so much.

To add the colon and also left align use:
=Format([ADate],"mmmm yyyy\:")

Or ... you can leave it right aligned and add the colon by simply
setting the control's Format property to:
mmmm yyyy\:
 
Thanks. Now it is working.
--
Chrissy


Douglas J. Steele said:
=Format([SinceDate], "mmmm yy") & ":"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Chrissy said:
Oops! Spoke too soon. It worked on a Count(*) control.

When I enter the control name it is ignoring my format of mmmm yy.
If I enter the control source I get error.

Did I miss something?

Control name is [txtSinceDate]
Source is =[SinceDate] & ":"

--
Chrissy


Douglas J. Steele said:
Instead of putting the field name as the ControlSource, put

=[FieldName] & ":"

Make sure that the name of the control isn't the same as the name of the
field: it'll set up a circular reference otherwise.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I
want
to
left justify and follow with a colon. Presently, I am right justified
and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find
such
information?

Thanks so much.
 
It works...thanks.
--
Chrissy


BruceM said:
=Format([SinceDate],"mmmm yy") & ":"

Not exactly sure what you mean by "enter the control source".

Chrissy said:
Oops! Spoke too soon. It worked on a Count(*) control.

When I enter the control name it is ignoring my format of mmmm yy.
If I enter the control source I get error.

Did I miss something?

Control name is [txtSinceDate]
Source is =[SinceDate] & ":"

--
Chrissy


Douglas J. Steele said:
Instead of putting the field name as the ControlSource, put

=[FieldName] & ":"

Make sure that the name of the control isn't the same as the name of the
field: it'll set up a circular reference otherwise.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Is there a way to add a literal to a control source?

My control returns Month and Year. Months are differing lengths. I
want
to
left justify and follow with a colon. Presently, I am right justified
and
follow with a label whose caption is a colon, but this looks messy.

I'm betting it is do-able, but I cannot find out how. Where can I find
such
information?

Thanks so much.
 
Back
Top