Runtime 2135 Error

BettyWho

Registered User.
Local time
Today, 05:04
Joined
Jun 7, 2013
Messages
37
Hi

I''m having an issue when I run a dLookup in a form

when the query runs I get a runtime error 2135 advising that the record is read only and can't be set.

I've done a bit of research and can't figure it out.

The Dlookup I am using is supposed to look at a table Client ID and return a fullname into the Name text box.

this is the Dlookup I'm using

Private Sub ID_AfterUpdate()

Name = DLookup("[FullName]", "QFullname", "[ClientID]= ID")

End Sub

Both fields are text boxes and doesn't seem to be anything wrong with the query itself it just wont write to a new table.

Also to note I have used the exact same Dlookup in previous databases and never had an issue what am I doing wrong in 2010?

Thanks in advance
 
Does the textbox have a formula in the control source? Is the form's source read-only? Function should probably be:

DLookup("[FullName]", "QFullname", "[ClientID]= " & ID)

This might be an alternative if you're using a combo:

http://www.baldyweb.com/Autofill.htm
 

Users who are viewing this thread

Back
Top Bottom