Refreshing Fields

maxxximaniac

Registered User.
Local time
Today, 05:05
Joined
Oct 22, 2004
Messages
80
Hey All,

I have a field "NameView", irrelevant but it grabs a name from a seperate form from an ODBC connection.
The purpose for the field is simply to grab the data from another form.

On the same form As NameView theres another field "Name"
This Grabs the data from NameView and writes to the main table.

Everything works fine but "Name" will only update from "NameView" on a new record only and not on the current one.
I have a VBA Statement on an afterupdate which Me.Name = Me.Nameview

I've tried Me.Refresh and Me.Requery but no help.

Any thoughts?
Much appreciated
Thanks
 
If you had a Save button you could try something like this to save the current record...

Code:
Me.Name = Me.NameView
DoCmd.RunCommand acCmdSaveRecord
 
I get back

"This Property is read-only and cant be set."
 
You might be confusing Access. Name is a reserved word in VBA and there are a bunch of others like Date, etc. You should also be using a naming convention for your db objects and be referencing the object [text box] and not the control "source". txt is common to prefix a text box control. Assuming your two objects [text boxes] are renamed accordingly this might help...

Code:
Me.txtName = Me.txtNameView
DoCmd.RunCommand acCmdSaveRecord
 
It works! I didn't know Name was one of those functions..
Thank you VERY much! Can't express how happy I am right now, been working on this for like 3 hours now...

Neighbors in the cubes are looking at me like im crazy, haha
Thanks!
 

Users who are viewing this thread

Back
Top Bottom