No Value - Runtime Error 2427

G

Guest

I have a form and a subform. When the client ID is entered on the form; I
want the Client Name (Me!txtClientName) to appear on the form if available.
The Client Name is retrieved from the subform. It works great if the client
is not new. But if the client is new then there is no data available. Then
I get "Runtime Error 2427...You entered an expression that has no value".
What can do if there is no value in the subform.

[Latest Client Name subform].Requery 'Requery subform - check for existing
client
Me!txtClientName = IIf([Latest Client Name subform].Form![ClientName] = "",
"", RTrim([Latest Client Name subform].Form![ClientName]))

Thanks for any help. Lamar
 
G

Guest

You could preface it with On Error Resume Next, maybe.

Also, you could replace your IIF statement with
Nz([Latest Client Name subform].Form![ClientName],"")
This probably won't fix the problem, but it'll be neater code.

Barry
 

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