Expression stopped working

  • Thread starter Thread starter Randifprf
  • Start date Start date
R

Randifprf

I have had this expression denating a IDNumber
=[StudentID] & Left([FirstName],1) & Left([LastName],1) &
[InstClID]
Now It has stopped working
Get Runtime Error 2113
This is the code but I get a #Name? in the text box
containing the expression.

Private Sub InstructorPP_DblClick(Cancel As Integer)
Me.IDnumber.Value = InstIDtxt

End Sub

Any Ideas
 
First you should narrow out the possible source for this error.
Remove the expression, and rebuild bit by bit:

=[StudentID]
=[StudentID] & Left([FirstName],1)
=[StudentID] & Left([FirstName],1) & Left([LastName],1)
and finally
=[StudentID] & Left([FirstName],1) & Left([LastName],1) & [InstClID]

This way you can tell which element is causing the error.
By first quess, it could be that FirstName or LastName is NULL. In that
case, replace with Left(Nz([FirstName]),1).
 
Tried that thanks, but seems like as soon as I put text
values in it breaks it.
Both IDs work but putting either firstname or Lastname in
breaks it
 
Try to compact & repair the database. If your tables are linked, compact &
repair the linked table as well.
 
Have tried these suggestions and it still doesn't work.
I do have a older version of this dBase that works. I
imported the form but still have not resolved the Problem.
Thanks for all your help to now. Still looking for the
problem though.
 
Randifprf said:
I have had this expression denating a IDNumber
=[StudentID] & Left([FirstName],1) & Left([LastName],1) &
[InstClID]
Now It has stopped working
Get Runtime Error 2113
This is the code but I get a #Name? in the text box
containing the expression.

Private Sub InstructorPP_DblClick(Cancel As Integer)
Me.IDnumber.Value = InstIDtxt

End Sub

Any Ideas

Is that expression the controlsource of a text box named "InstIDtxt"?
Is it possible that there is a field in the form's recordsource that is
also named "InstIDtxt"?. You cannot have a control with the same name
as a field in the form's recordsource unless the control is bound
directly to that field. Check that this isn't what has happened.
 
Back
Top