Link to home
Start Free TrialLog in
Avatar of actolex31
actolex31Flag for United States of America

asked on

Updating a table with information from a form

I have a form that's based on a query and the user can add a few more fields on the form.  I want to update a table with the data that is on the form.  The form is bound by the query but since the user adds info on the form, I want the form to update another table.
Avatar of als315
als315
Flag of Russian Federation image

Usually you should create update query with values from your form. Can you upload DB with sample data and explain expected result?
As als indicates, you can do this with a query or with straight SQL. For example:

Currentdb.Execute "UPDATE MyOtherTable SET Field1=" & Me.SomeValue & " WHERE MyOtherTable.TheIDField=TheIDValue"

Obviously you'd need to know several details to get this to run correctly - the names of the tables and fields, the id values, etc etc.

I have to ask - what's the reason for updating another table, other than the one bound to the form?
Avatar of actolex31

ASKER

The table that the query is based on is a table of reports that my employees must read.  There are 8 reports (records) in a table called "tblCommDocs".  My initial form "frmStartUp" the employee pics their name and the report they want to read which leads to another form called "frmCommRef".  This form has 2 text boxes that reference the employee name and the report selected in the initial form and also the fields from the query (table).  I want all the fields from "frmCommRef" to update a table.  I can't update the base table "tblCommDocs" but since there will be many records created since the many employees will be reading each report.
I should add the resulting table will be a list of all the reports read by each employee.  This table will be a longer list with the report, employee who read it, and the date they read it.  This is why I cannot update the origin table since it only lists the 8 reports available.  The resulting table will be many records long.  Hope that makes sense...hard to post the database since it has proprietary data but I will try to create a dummie.
SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
als315....interesting fix.  A little different than I planned but I may try this.  

Otherwise, is there a way to update the data in a form to a table....append it to existing records?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How do you base the query on the form?  I thought it coiuld only based on a query or table.
No, you can select field from form in query designer (use build option, select your form and field)