I have a report which outputs (among other things) a field called proj_num (for the project number) and proj_desc (for the title of the project). Right now, I have those as two separate text fields. But I have to leave quite a bit of space to allow for varying lengths of project numbers. So my report might look like:
PN 1.45.33954 __Timekeeping
(Underscores added for formatting placeholders)
Or something like that. What I'd like to do is append the proj_desc field to the proj_num field to create:
PN 1 - Admin
PN 1.45.33954 - Timekeeping
I thought I could use this as the control source for the field:
=[proj_num] & " - " & [proj_desc]
But that didn't work, it returned "#ERROR" on the report.
I also tried:
=[proj_num] + " - " + [proj_desc], but it returned the same error.
Any ideas? Can a text field have multiple control sources? Thanks in advance.
Which? The first, with the ampersands? That's how other VBA stuff works that I've done (using the apersands to append fields), so I figured it'd work here too.
It doesn't give any runtime error message. The field just contains the text "#ERROR" on my report. Any ideas what that means? When I generate the report, I'm using data that contains valid information for those two fields (proj_num and proj_desc).
Actually - just thought - I've been stung by an Access "feature" before now that causes this.
Do you have any Controls called proj_num or proj_desc? If so, change the name (say txtProj_Num). Also (here's the killer) check that the forumla you enter (=[proj_num] & " - " & [proj_desc]) has not been "helpfully" changed by access too.
What's the name of the textbox you're using to concatenate your field values? It can't be the same as any of the fields you're evaluating or it will get pissy about a circular reference and display a #NAME error.
the aim is store once, not store multiple times
Remember... Optimize 'til you die!
Progaming environment: Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010 VB based on my own environment: vb6 sp5 ASP based on my own environment: 5.6 VB-NET based on my own environment started 2007 SQL-2005 based on my own environment started 2008 MYLE YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.