Concat fields

artur

Registered User.
Local time
Yesterday, 17:24
Joined
Oct 13, 2007
Messages
17
I have a TableA and one of the fields is FileName (filename1.mpg, filename2.mpg...).

On a Form, I have a box and I want there to have this string for the first row:
"/VIDEOS/filename1.mpg".

How can I do that? THANKS!
 
On a Form, I have a box and I want there to have this string for the first row:
"/VIDEOS/filename1.mpg".
Are you wanting the directory location? Or just a set string before the field value (filename.whatever)?? If the string you want in the box is what you listed above, and your field values are things like "filename1.mpg", "filename2.mpg", etc..., then write...
Code:
Me.BoxName = "/VIDEOS/" & Me.ControlThatHoldsTheNameOfFieldValuesYouWant
...on an event. Maybe OnCurrent?
 
Where do I write this? I've tried that on the "default value" field of the box, at design view of the form.

There I write
= "\VIDEOS\" & [FileName]

But when I try it, I just get only the string "\VIDEOS\". What's wrong?

Best regards!
 
On your Table or somewhere else create a Path do that complete file path can be displayed. Do it in the Query, if your Form is Query based:

FileLoc = [Path] & [FileName]

Simon
 
Sorry, but it doesn't work, I cannot concat two strings or fields this way.
I repeat the idea:

I have Table1 with a field FileName (filename1.mpg, filename2.mpg, ...).
What should I write on the "default value" field of a box in a FORM, so that it is as default: "\VIDEOS\filename1.mpg" for the first row, "\VIDEOS\filename2.mpg" for the second, and so on?

On the same form also there is a box with the FileName field.
 
There I write
= "\VIDEOS\" & [FileName]

But when I try it, I just get only the string "\VIDEOS\". What's wrong?
That is the correct syntax. The program is not reading the [filename]. So, the reference is invalid. Perhaps it's not the name of a field that the other control is bound to. That would be the best explanation. Check the controlsource line in the control's (the one that you are concating) properties box. If it does indeed say "filename" in it, then something else is wrong with the box you are updating, or there is no data in the "filename" control (text box) when the form loads. Keep in mind that a default value is set as soon as your form loads. If you make changes to a default value after it loads, it won't take effect until the next time you load the form. But, it might take effect if you just move to another record.
 

Users who are viewing this thread

Back
Top Bottom