Results 1 to 6 of 6
  1. #1
    hlcarlin is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    12

    Apply same value to all text boxes on form

    Hello, I have a form where I need the same number to be entered in 15+ text fields and I would like to set it up in a manner where you enter the number once in a "master" text box and then the 15+ textboxes automatically take on that value so the user only needs to enter the value once and then save the form. Would doing something like this be possible in Access?

    Thank you

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    While this appears to be an unusual request, I think that you can complete this task by employing a little bit of code

    In the afterupdate event for the original text box (assume name is mytxt) enter this code:
    Code:
    me.txt1.value=me.mytxt.value
    me.txt2.value=me.mytxt.value
    .
    .
    .
    me.txt15.value=me.mytxt.value
    End Sub
    each of the other 15 text boxes are named txt1, txt2.....etc

    change the textbox names to your control names. I would be curious as to how you are using this and why you need to have this set up.

    Alan

  3. #3
    hlcarlin is offline Novice
    Windows XP Access 2007
    Join Date
    Jun 2011
    Posts
    12
    Thank you very much! Solution worked perfectly!

    The reason I needed to do this is that the database I am currently working on is has been designed in a poor manner and the cost/benefits of re-doing the whole thing do not suggest I should start from scratch... So I need to work around certain relationships between tables by manually inserting values into the tables.

  4. #4
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    I sort of figured that was the case. Here is a link that you may want to look at regarding changing non-normalized databases to normalized. I don't know if this would apply in your case or not. Good luck

    http://www.datawright.com.au/access_..._using_VBA.htm

    Alan

  5. #5
    george.vniekerk is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Jul 2011
    Posts
    9
    How would one change the above code in the case of a form & Sub Form? I would like to assume the field entry from the form to a field in the Sub Form.

  6. #6
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Take a look at this video on how to reference subforms.

    http://www.datapigtechnologies.com/f.../subform2.html

    Alan

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. Creating a Form with 2 combo boxes and a text box
    By smorris4804 in forum Access
    Replies: 1
    Last Post: 06-17-2011, 02:06 PM
  3. Position text boxes on form
    By Mclaren in forum Forms
    Replies: 4
    Last Post: 05-10-2011, 12:24 PM
  4. Apply Filter based on unbound date boxes
    By anoob in forum Access
    Replies: 3
    Last Post: 01-21-2011, 05:26 PM
  5. Replies: 15
    Last Post: 09-18-2010, 01:19 PM

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