Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    2

    Unanswered: Data from form to new table

    Hello all - -

    I'm working with an access database that has one table, some queries, some forms and some reports. I just created a new form that is filtered down to one record showing employee's info...name, location, salary..etc. These textboxes are linked to a table named: activeEEcount. The form also contains about 10 textfields that are unbound. The user enters a date from an activecontrol date picker. Then hits an update button. Once hit the other 10 or so textboxes are populated with data. All so good for now.

    What I'd like to do is add a new button (or code to an existing button) that would take all the fields, bound and unbound and add them to a new table.

    First of all, is this even possible? Taking data from an unbound textbox and populating a table? I need some suggestions to get me started. Would a create a new table with field names the same name as my textboxes? Would I then create some sort of update query that takes that info and dumps it into a table? I'm confused on what I should do here, what I should do first...etc....any advise would be great.

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Welcome to the forums!

    Quote Originally Posted by ironman9079
    What I'd like to do is add a new button (or code to an existing button) that would take all the fields, bound and unbound and add them to a new table.
    Do you mean that you would like to create a new table with the data, or insert a new record into a preexisting table? If I assume the later of the two, then you can create and run an Append query with the data, or use dao recordsets (assuming the table is stored in the same Access database that this form is in). Else, if you really want to make the table and then add the data, I would use a Make Table Query and then populate it via one of the two aforementioned methods.
    Me.Geek = True

  3. #3
    Join Date
    Feb 2009
    Posts
    2
    Good morning, and thank you for your reply. Yes, what I'd like to do is create a new table from the contents of the form. Then when the form is opened again, a button is hit to append the newest form data...and so on.

    So, in thinking about the query, am I able to create a new query and have the source be that of a form? Like you would select in the wizard a table or a query as the source? If I do this from scratch (so to speak) would I enter something like =form!frmName!texboxName....? Would I need two queries? One to Make the Table, then another to apend new data?

    Thanks again...

  4. #4
    Join Date
    May 2005
    Posts
    1,191
    I'm not sure how familiar you are with SQL and VB, but I think Martin Green's six part lecture might clear up some of these questions for you. Let us know if you still have questions/ what questions you have.
    Me.Geek = True

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •