Change 2 field names with vba code within a form

anchamal

Registered User.
Local time
Today, 10:25
Joined
Mar 7, 2010
Messages
57
I have two text fields:
their names are :

field 1 ="txtfilter"
and
field 2: "text333"

how can i change the names of the two fields with vba code?

i need field 1 to get the name of field 2
and field 2 to get the name of field 1

this will be temporarily.
using access 2013
 
Just curious : Why? would this not cause instability for everything you have been working with?

Anyway a simple Google search using the words : "Rename field names vba access" should give you the answer..
 
already googled but when i place the codes in the on click command of a button i get compile error

txtfilter.Caption = "TXTFILTER2"
Text333.Caption = "TXTFILTER"
 
Okay Fundamentals time.

Field belongs to Tables - Their names will be defined during Table creation.
Controls belong to Forms - Their names will be defined during Form creation

Fields Is Not Equal To Controls

So txtFilter and Text333 are they Controls or Fields? I am guessing Controls, so what is the compiler error say?
 
the error is:
medod or data member not found
they are just fields
they do not belong in a table
if this is what you are asking
 

Users who are viewing this thread

Back
Top Bottom