How populate field on a form with DLast

I have a main form that has a text box which I'd like to populate with a DLast when the form opens.  I've put the following in both the onopen and onload event of the form but get an error...

"You can't assign a value to this object".

Here's my code.  What's wrong with it?

Me.txtdbVersionN = DLast("dbVersion", "tblDatabaseVersion")

--Steve
SteveL13Asked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:
how about using DMax instead


Me.txtdbVersionN = DMax("dbVersion", "tblDatabaseVersion")
0
 
SteveL13Author Commented:
Am getting the same error message with DMax.  ??
0
 
Rey Obrero (Capricorn1)Commented:
check if the textbox  "txtdbVersionN" is bound to a field in a table, make the textbox Unbound.
0
 
SteveL13Author Commented:
Sorry.  DMax DID work.  I just types it wrong.  Thanks as always.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.