By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,225 Members | 1,434 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,225 IT Pros & Developers. It's quick & easy.

A2K - update to field problem

P: n/a
I'm updating a field by saying;

me.txtName = varName

But if I step through the code and do a dlookup on this field it's null.
Looking at table while the code is running also show the field to be null.

After the code completes and I'm back on the form, the table does indeed
show the value.

How is this happening? I need to refer to this value in code but it's no
good to me if it's null.
thanks
Martin


Feb 14 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Deano wrote:
I'm updating a field by saying;

me.txtName = varName

But if I step through the code and do a dlookup on this field it's
null. Looking at table while the code is running also show the field
to be null.

After the code completes and I'm back on the form, the table does
indeed show the value.

How is this happening? I need to refer to this value in code but
it's no good to me if it's null.
thanks
Martin


Ah, I tried

DoCmd.RunCommand acCmdSaveRecord

after the offending line and that seems to have worked...
Feb 14 '06 #2

P: n/a
What criteria are you using in your DLookup statement?

varName = DLookup("fldx", "tblx", "RecordID = " & someVal)

I would create a basic Access Query on the same table, same field and
same criteria and see what you get. You may not have any values in your
table for the criteria you are using. A query will give you the same
result as DLookup. Most likely your criteria needs to be changed.
Rich

*** Sent via Developersdex http://www.developersdex.com ***
Feb 14 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.