Text field returns form name, not the field 'name'

mrlw00r

Researcher
Local time
Today, 08:15
Joined
May 24, 2003
Messages
24
I'm trying to set a text field on a form using a field from the recordsource called 'name'.
Setting the control source to...
code works correctly, showing the code field, and
name also works correctly, showing the name field, but
=code & " " & name returns the correct code field, and then the name of the form (eg frmForm1)
Writing the full field names...
=[module]!
Code:
 & " " & [module]![name]
produces #error... and removes the square brackets. This seems a little strange!
How should I sort this one out?!
thanks in advance
 
You should not be naming any of your fields Name as it is a reserved word in Access. Type reserved words into help to see a list of others.

Next up, use prefixes on your objects. For a textbox prefix it with txt, a combo (cbo) and so on.

Now, with two textboxes called txtCode and txtName you can set the ControlSource to be:

=[txtCode] & " " & [txtName]
 
Last edited:
Oh. That's a shame isn't it....
There really are some things one should check up on sometimes...!
I always name controls appropriately, makes everything a lot easier. As for this field name, it doesn't appear to be causing problems elsewhere (at the moment) so it's not essential to change it. Since the database is now live I'll have to do a manual change later... (ouch)
Thanks for the info!
 

Users who are viewing this thread

Back
Top Bottom