Results 1 to 3 of 3
  1. #1
    mctanmar is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2015
    Posts
    1

    How do I use an inputted field in a form to enter automatically in another


    Hi All,

    Hope you can help. I have a form where I select either "Male" or "Female" via tick box. If male is selected I would like it to automatically enter "he" in my table in another field so I can use this info in a Word template letter.

    Thanks in advance
    Mark

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    1.put an unbound frame, named fraSex, on the form, in it the 2 radio buttons M, F. (M value = 1, F value = 0)
    (remember the FRAME gets the value of the radio buttons, not the buttons)

    2. put a text box called txtSex, bound to the field and make it invisible.
    3. in the AFTERUPDATE event of fraSex, put this code:

    Code:
    sub fraSex_Afterupdate
         if fraSex.value = 1 then
            txtSex = "he"
         else
            txtSex = "she" 
         endif
    end sub

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    There may be a better way to approach this. But, you could bind a control to your second field that is within your table. Code behind the form could handle the After Update event of your tick box. I suspect you have created an option group that has two radio buttons. So you would use the name of your option group within the VBA code. Create an After Update event for your option group. Also, you need to understand what the default values for your option group are.

    if me.OptionGroupName.value = Something then
    me.secondcontrol.value = "He"
    else
    me.secondcontrol.value = "She"
    end if

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

Similar Threads

  1. Replies: 12
    Last Post: 06-12-2014, 07:37 AM
  2. Replies: 2
    Last Post: 05-19-2014, 07:45 AM
  3. enter ID automatically or manually
    By msasan1367 in forum Access
    Replies: 3
    Last Post: 06-03-2013, 10:21 AM
  4. check the format of an numeric inputted field?
    By eliotchs in forum Programming
    Replies: 1
    Last Post: 04-20-2011, 11:35 AM
  5. How do I enter data automatically?
    By ffurqana in forum Access
    Replies: 0
    Last Post: 07-08-2010, 07:47 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