combinding text and date fields

  • Thread starter Thread starter Simpleton DuJour
  • Start date Start date
S

Simpleton DuJour

I wish to make a combo field consisting of field datefield
and field namefield in my query, i.e. [namefield]+"-" +
[datefield]. It won't take. How do I
convert datefield temporarily into a text field so I can
create my combo field,
 
Try using & as the concatenation character rather than +.

If that doesn't work, use the Format function to convert your date into a
string:

[namefield] & "-" & Format([datefield], "General Date")
 
You also need to check the name of the control you are concatenating, make
sure it does not match the name of a field in your Record Source.

For if you do it will show "#Error". Just a glitch in all Access versions
(AFAIK).

HTH,

joemach
 
Just curious as to why you call that a "glitch". What would you expect
Access to do if you refer to a non-existent field? AFAIK, we're years from
software that can do what we mean, not what we say...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



joemach said:
You also need to check the name of the control you are concatenating, make
sure it does not match the name of a field in your Record Source.

For if you do it will show "#Error". Just a glitch in all Access versions
(AFAIK).

HTH,

joemach



Simpleton DuJour said:
I wish to make a combo field consisting of field datefield
and field namefield in my query, i.e. [namefield]+"-" +
[datefield]. It won't take. How do I
convert datefield temporarily into a text field so I can
create my combo field,
 
Doug,

I call it a 'glitch' because I have chased my tail on trying to figure it
out. I knew the code was right and still kept getting the #error. Being a
little thick-headed on the thing I wrestled with it until I figured it out.
It is not in the documentation, that I know of, I thought it would be data
he would want to have on developing his app.

Also, I have done more VB development and am used to the controls not being
named the same as the Data Source.

But you do make a good point. It can be frustrating if you don't know about
it. I guess I could have called it a 'feature', but I don't think that
describes it as well.


joemach



Also
Douglas J. Steele said:
Just curious as to why you call that a "glitch". What would you expect
Access to do if you refer to a non-existent field? AFAIK, we're years from
software that can do what we mean, not what we say...

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



joemach said:
You also need to check the name of the control you are concatenating, make
sure it does not match the name of a field in your Record Source.

For if you do it will show "#Error". Just a glitch in all Access versions
(AFAIK).

HTH,

joemach



I wish to make a combo field consisting of field datefield
and field namefield in my query, i.e. [namefield]+"-" +
[datefield]. It won't take. How do I
convert datefield temporarily into a text field so I can
create my combo field,
 
Back
Top