Results 1 to 13 of 13
  1. #1
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130

    Adding Records with a Form

    Hello, I was wondering if someone could help me add records to a datasheet with a form. Once I click the commandbutton 'Apply', I would like for all of the fields in the datasheet to be filled with the appropriate values from the form.

    Thanks

  2. #2
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Pretty confused about the question, or many by the question.

    Datasheet is a form. Forms are usually populated (filled) with data from a query/table.

    If you are wanting to add data to a table in datasheet view the bind the table to the form.

    If this is not the case then please restate your question.

    Dale

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    I assume that when you say a "datasheet", that what you mean is a table. A form is usually bound to a table by setting its "Record Source" property and each control on the form is bound to the tables data by setting the "Control Source" property of each control. When used like this there is no need for an "Apply" button. Just closing the form or moving to a different record will make Access update the bound table.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    I would like to have it set up that the user never needs to know that the table exists. Just a form that is very easy to use.

  5. #5
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    And this way, it adjusts a record within the table. I want it to add a completely new record to the table.

  6. #6
    rzw0wr is offline I will always be a newbie
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Indiana
    Posts
    479
    Build a new form. Add a combo box with the data you want to display.

    Add a few text boxes and play around a little.

    We can better help you with that then.

    And this way, it adjusts a record within the table.
    I don't understand?

    You can add new records to your table if needed.

    EDIT: Per Bob's post. You should not need an Apply button.
    You may need to upload you db.
    Dale

  7. #7
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by dylcon View Post
    And this way, it adjusts a record within the table. I want it to add a completely new record to the table.
    Then go to a "New" record. You can make the form open at a new record if you wish.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  8. #8
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Bob, how exactly do I do that?

  9. #9
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Put the following line of code in the On Open event of the form:
    DoCmd.GoToRecord , , acNewRec
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  10. #10
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    That does not work. Can you please use code tags?

  11. #11
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Nevermind, it did work. Thanks a lot for the help. Sorry, I am so poor at this. I am not familiar with VBA in Access whatsoever.

  12. #12
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by dylcon View Post

    ...I would like to have it set up that the user never needs to know that the table exists...
    A good policy! End users should never have access to your Tables, and since they shouldn't have access, there's no need to even know about the Tables!

    Quote Originally Posted by dylcon View Post

    ...I am not familiar with VBA in Access whatsoever...
    Take heart; we were all there at one time! And your first statement, above, shows that you are on your way to learning!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  13. #13
    dylcon is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Ann Arbor
    Posts
    130
    Thanks for the words of encouragement, Linq. Much appreciated.

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

Similar Threads

  1. Adding records to a table from a form
    By paulofranchico in forum Forms
    Replies: 1
    Last Post: 02-07-2012, 11:30 AM
  2. Adding multiple records from one form
    By sotssax in forum Forms
    Replies: 8
    Last Post: 07-17-2011, 11:16 AM
  3. Replies: 10
    Last Post: 01-10-2011, 07:52 PM
  4. Replies: 1
    Last Post: 08-03-2010, 01:33 PM
  5. adding records through form
    By Rayk in forum Forms
    Replies: 1
    Last Post: 01-09-2010, 07:55 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