Results 1 to 4 of 4
  1. #1
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102

    Transfer data from form to table with Yes or No field

    I have this form:


    Click image for larger version. 

Name:	Screenshot 2022-11-09 210256.png 
Views:	12 
Size:	3.1 KB 
ID:	49066
    And the data from this form will be transferred to this table:
    Click image for larger version. 

Name:	Screenshot 2022-11-09 210342.png 
Views:	12 
Size:	3.1 KB 
ID:	49067

    I have this code for that:
    Code:
    Set db = CurrentDb
        Set rs = db.OpenRecordset("tblOfferte")
            With rs
                .AddNew
                
                !Bezeichnung_1 = Me!Bezeichnung1
                !Einheit_1 = Me!Einheit1
                !Anzahl_1 = Me!Anzahl1
                '!Per_1 = Me!Per1'
                !Einheitspreis_1 = Me!Total1
                !Summe_1 = Me!Summe1
      
                .Update
            End With
        rs.Close
        Set rs = Nothing
        db.Close
        Set db = Nothing
    But I don't know how to make it so that when the user clicks on the radio button "Per" in the form, it is ticked in the table at "Per_1". How should I solve this?

  2. #2
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    299
    Do not use a radio button but a check box.
    Groeten,

    Peter

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,250
    What is the name of the option (radio) button control? You should use Me. instead of Me! to get the use of Intellisense.
    It should work the way you have it but also try:
    Code:
    !Per_1 = Iif(Me.Per1=True,-1,0) 'assumes the radion button is named Per1
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    Akchayan is offline Competent Performer
    Windows 7 64bit Access 2016
    Join Date
    Aug 2022
    Posts
    102
    Quote Originally Posted by Gicu View Post
    What is the name of the option (radio) button control? You should use Me. instead of Me! to get the use of Intellisense.
    It should work the way you have it but also try:
    Code:
    !Per_1 = Iif(Me.Per1=True,-1,0) 'assumes the radion button is named Per1
    Cheers,
    Thank you very much it worked!

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

Similar Threads

  1. Replies: 9
    Last Post: 03-16-2014, 02:30 PM
  2. Replies: 3
    Last Post: 06-19-2013, 02:39 PM
  3. Data Transfer from one field to another
    By Sahara May in forum Access
    Replies: 1
    Last Post: 08-01-2012, 12:30 AM
  4. Transfer data from ListView to Table
    By Zyckie in forum Access
    Replies: 1
    Last Post: 12-15-2009, 11:23 AM
  5. Replies: 3
    Last Post: 04-23-2006, 09:09 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