concatenation

  • Thread starter Thread starter ccw
  • Start date Start date
C

ccw

Please excuse the basic question....I'm not entirely new to Access, just
fairly new to doing calulations or default values within Access. In the
past, I've done all my coding work in a web page that accesses Access
DB's. So I'm green when it comes to Forms & Reports. I've mostly just
dealt with Tables and Queries.

I'm trying to make a Field (MyFileName) in a Table have a value which
is concatenated from a date plus 2 other Fields in the same Table and
Record. I don't want to Sum the values, just put them in a string.
And in order to make things a little more readable, I'd like to have an
underscore character between the 3 values.
so a sample might look like: 20040129_1_38

I'm assuming I should put this in the Default Value of the Field I have
named "MyFileName".
Please let me know if this is not possible for a default value, or if
it should go somewhere else.

I've tried a variety of things similar to this:
Date () & "_" & Forms![VideoFiles]![SectionNumber] & "_" &
Forms![VideoFiles]![dvID]
Date () & "_" & [SectionNumber] & "_" & [dvID]

And I'm getting different error messages, but mostly that it can't find
a value or something like that.

My fields are:
dvID = AutoNumber
SectionNumber = number (default value is 1)

Can I do this in a Table? Or do I have to use a Form, Query? Or what?
 
I'm trying to make a Field (MyFileName) in a Table have a value which
is concatenated from a date plus 2 other Fields in the same Table and
Record. I don't want to Sum the values, just put them in a string.
And in order to make things a little more readable, I'd like to have an
underscore character between the 3 values.
so a sample might look like: 20040129_1_38

This field SHOULD NOT EXIST in your table. It's redundant and
unnecessary.

Your expression will not work in the Table, or as a default - but you
can create a Query based on the table, and use your expression in a
vacant field cell. This query can now be used on your webpage just as
if it were a table.
 
Back
Top