how to update records through Forms

welshgasman

Well-known Member
Just bind the controls to the source data and it will do it for you.

Use the form wizard to create a form when on the table or query that will be the recordsource for the form.
 

Micron

Well-known Member
In addition to binding, it mighty be worth mentioning that in order to commit changes or additions to a form's set of records, you have to do something to cause the change to be committed. This could be any one of
- moving off the record; e.g. going to next or previous if a single record form or going from one record to another in a datasheet or continuous form
- moving off the form; e.g. clicking off a main form onto a subform or vice versa, when fields on one have been updated and you click on the other
- closing the form or database (relying on this to save a record isn't the best approach)
- using code to update or commit the record, such as when using a command button.
 

zeidhaddad

New Member
thank you so much for your answers! what you are doing to the community is extremely helpful :D

Mr.Micron you seem to be a master at access, the phrase = "you have to do something to cause the change to be committed" Is exactly representing my case.
i would say my problem will be solved using the 4th method that you mentioned "
- using code to update or commit the record, such as when using a command button."
I've been stuck for 3 days now because i don't know the coding in VBA to solve my problem.
if you have the time and effort i would be really glad if you could help me in generating this code which updates the records automatically when filling in the input in the form.
i also
apologize for my poor elaborating skills i'm not really an expert in these kind of stuff
Thank you Sir and have a great day!
 

Micron

Well-known Member
You would have to provide details about the form design and its recordsource. Start with the latter - is it bound or not?
Then,
is it single record view,
datasheet or continuous,
main form and subform and what type is the subform
or something else?
 

zeidhaddad

New Member
Hello! and happy Monday :D
The details are the following:
I have 2 tables and 1 Form!
I'm Pulling the data From table 1 through the form i have and then save it in table 2 (documentation).
i think the code is something like this OpenRecordset(Select * From Table 1 Where Customer number = Etc.)
 

Micron

Well-known Member
A bit confused. In your post you wanted to know how to update records. Now you are saying you want to append records to another table (this is not updating) yet you seem to have these records in a table already. Perhaps you shouldn't be doing this, so I'll ask why you are copying from one table to another. Details on what's going on?
 

Some videos you may like

This Week's Hot Topics

  • Get External Data (long shot question!)
    This is likely a long shot but I am wondering if it is at all possible for Excel to somehow 'change' the contents of a URL that is being linked to...
  • Importing multiple excel files into one spreadsheet
    Hi, I'm trying to import multiple excel files (with the same format into a single spreadsheet) so that each day's file is listed underneath the...
  • Cell Formatting
    Good Morning, I need to format a few different cells in the following manners: A1 has to always add a colon (:) after whatever is typed in by a...
  • How to copy multiple rows using If
    Hi all, I'm very new to VBA and have written this simple code to copy certain cells if a certain cell within that row contains any data. I need...
  • Workbook_Change stopped working !
    I am working on an app to speed up & automate processing of Credit Cards statements. After data is input from a CSV file, it is presented to the...
  • VBA If statement
    Dear All, I have two dates, where I'd like a message box to pop, if the dates are between this criteria. [CODE] sDate1 = #10/1/2019#...
Top