default value - expression builder

T

The Boondock Saint

Im trying to set up a text field so that when a new entry is entered into
the database it will have the path name to a directory.... but i need it to
also add on a number which is in another feild....

for example....

"c:/mydocs/photos/"
and also add on the ID Feild of the listing which would be say 11

so that the resulting default for that listing would be
"c:/mydocs/photos/11"

anyone got any ideas if this can be done....
 
A

Allen Browne

You want the basic path "c:/mydocs/photos/" to apply to all entries, and you
have the specific number in another field.

Consider creating a table to hold values like the path. You can then look up
the table to get the path and append the number at the time you need it.

For example, you could create a table with fields:
Variable Text
Value Text
Save as (say) tblSys (for your system variables.)
Enter a record where the Varaiable column contains (say):
PhotoPath
and the Value is:
c:/mydocs/photos/

On your form, if you have the 11 in a field named Field2, you could use a
text box with ControlSource of:
=DLookup("[Value]", "tblSys", "[Variable] = 'PhotoPath') & [Field2]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top