Results 1 to 8 of 8
  1. #1
    bomber72 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    8

    Post Form to Table

    Alright Guys,



    I have a form that has a combo box, 3 option groups all with radio buttons, and a text box. I have a table that is supposed to be populated based on the selections made on the form. At the bottom of the form there is a button that, when clicked, runs a search of a query based on the input in the text box. I would like for the selected radio buttons, the option selected from the combo box, and the information put in the text box all to go to the table mentioned above when the button is clicked.

    I have no idea how to do this. Somewhat new to Access.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Is the form bound to the table, i.e. is the form RecordSource property set to the table? If so, bind the controls (combobox, textbox, option group) to fields of the RecordSource. Entries to the controls are saved directly to the table (although I am not quite sure about the option group, haven't used them for saving data).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    bomber72 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    8
    Thanks for the quick reply.

    The Form's RecordSource is set to the table. The thing that I don't get is how to link the correct text box, combo box, or radio button option box to the correct column in the table, and then how to activate it so that it does all this at a particular occurance, such as when the user clicks a button or something along those lines. Any thoughts?

    Thanks again

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Set the textbox and combobox ControlSource property to fields of the form's RecordSource. With the radio button option group bind the frame to the field. Any entry/selection made is immediately saved to table. No button click needed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    bomber72 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    8
    So I set all the ControlSource properties to the correct part of the table, but it doesn't seem to do anything. The inputs from the form just aren't going anywhere.

    Is ControlSource supposed to work that way? I thought it went the other way. Like if I had a combobox and some names in a table I could get them into the combobox by setting it's ControlSource to the table. But I guess not.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    ControlSource is two-way. Data already in table will display in the control, edits will be saved back to table. However, the data is not fully committed to the table until form closes or move to another record or run command to save record. If you are not getting this behavior something else is seriously wrong. Attach project for analysis. Run Compact & Repair first, zip if large.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    bomber72 is offline Novice
    Windows XP Access 2007
    Join Date
    Jul 2011
    Posts
    8
    I was messing with it and I was about to get on here and say something when I saw that you replied. I noticed that it was only updating when I closed the form and it's not saving old records but overwriting the past entry every time I do a new one. I'm thinking I should do a command to save the records. Would I have to do that in VB code or is there an easier way to set it up?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    You are opening form to an existing record and editing it. If you want new data must move to new record. You can do this several ways.

    1. Use the record navigation bar at bottom of form (assuming it is not turned off) to move to new record.

    3. Open the form to a new record, either by setting properties of form to only allow new record entry or with code to open form to new record.

    4. Custom button coded to move to new record.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 08-01-2011, 11:35 PM
  2. Replies: 9
    Last Post: 02-15-2011, 03:05 PM
  3. Replies: 2
    Last Post: 12-22-2010, 01:46 PM
  4. Replies: 1
    Last Post: 03-08-2010, 02:32 AM
  5. Replies: 0
    Last Post: 02-24-2010, 12:56 AM

Tags for this Thread

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