"Name" Error In Unexpected Places

TastyWheat

Registered User.
Local time
Today, 04:08
Joined
Dec 14, 2005
Messages
125
I have a basic form that shows employee information. A few of the fields are calculated or lookup fields. Starting with the first record I can go thru all of them just fine (I don't see any errors in the fields). If I look at my 2nd record twice then my combined name field (first name + last name) shows "#Name?". This error does not occur with my 1st record, just the 2nd one. Also, if I go to the end of my records to where a new record is going to be entered then I get extra errors in my 1st record.

It's kind of hard to explain exactly what's happening without pictures. I'll post some if you think it will help.

In any case, I don't see how a calculated field can work the first time thru but not the second time thru.
 
First of all, make sure that your control names are DIFFERENT than your field names - they should be for all fields (unlike the way Microsoft made it happen when you use the wizard to create a report or form), but you need it especially for when you use any kind of formula as the control source for a control.

Also, I would suggest using the ampersand (&) instead of the plus (+) sign for concatenation as using the plus sign will sometimes generate unwanted results if you run into strings that have numbers in them.
 
Well, I didn't mean what I said literally. I'm using this as my calculated control source:
Code:
=[FirstName] & " " & [LastName]
Those are the field names and not control names. I also have this calculated control source to show the employee's title:
Code:
=GetEmployeeTitle([txtEmployeeID])
That one looks a little more sketchy since in this case it's using a control name. Anyway it's still very odd that both of these controls show up perfectly the first time through.

I also checked all of my control names (using the drop-down box in the toolbar) and they're all renamed so they don't look like any of the field names.
 
If you can post a stripped down version of your database, it would make it easier for me to spot the problem (I'm way more visual), as I'm not sure what is happening then.
 
Link Fields Are More Than Just A Good Idea

Okay, here is a case of using code when I don't have to. Usually I don't use Link Master Fields or Link Child Fields, I just add code to filter the subforms whenever the record changes. Usually it doesn't make any difference (except for maybe slowing things down), but this time it freaked out and started screwing up other parts of my form. So I filled in the subform link fields and got rid of the redundant code. Now everything works just fine.
 

Users who are viewing this thread

Back
Top Bottom