How to edit a record through a form on MS Access?

2019-09-21 19:00发布

问题:

I'm new to Microsoft Access and I'm having a trouble implementing something. Basically, I have a form with a combo box, some text boxes, and a command button.

What I want to do is have the user select a record from the combo box, which then populates the textboxes (I've already managed to do this). Once the data has loaded into the textboxes, I want the user to be able to edit the info in the textboxes, then press the command button so that it updates that record in the table.

回答1:

This looks like the same odd form where you had trouble with delete. It sounds like you are working from the wrong end. Create a form based on a table or query, then add a combobox to find records on the form based on the selection. There are wizards to guide you through. You will then have a standard Access form where everything works as expected. When textboxes are changed, the data will be updated as soon as you move to another record, there is no need for save, it is the default for Access.

If you wish to use non-standard unbound controls, you will need to update with SQL or stored queries.