Results 1 to 6 of 6
  1. #1
    anchamal is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Dec 2010
    Posts
    15

    Change 2 fields name with vba code within a form

    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

  2. #2
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    Feild1.Caption = "Feild2"

    That will Do

  3. #3
    anchamal is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Dec 2010
    Posts
    15
    I PLACED THE CODE LIKE THIS IN THE ONCLICK EVENT OF A BUTTON:
    txtfilter.Caption = "TXTFILTER2"
    Text333.Caption = "TXTFILTER"
    BUT I GET COMPILE ERROR

  4. #4
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    The Label name must be incorrect, because of which it generates compile error

  5. #5
    anchamal is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Dec 2010
    Posts
    15
    nope it's correct

  6. #6
    drunkenneo is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    199
    u have to give the Label Name Properties>Other>Name, not the caption name

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Change width of subform in code
    By GraeagleBill in forum Programming
    Replies: 2
    Last Post: 12-02-2012, 04:57 PM
  2. Replies: 5
    Last Post: 11-20-2012, 03:44 PM
  3. Replies: 8
    Last Post: 01-30-2012, 02:13 AM
  4. Code for change PW frm not working(ish)
    By Desstro in forum Programming
    Replies: 4
    Last Post: 12-02-2010, 02:50 PM
  5. Replies: 1
    Last Post: 08-10-2008, 01:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums