Updating a table from unbound textboxes (1 Viewer)

magster06

Registered User.
Local time
Yesterday, 23:41
Joined
Sep 22, 2012
Messages
235
Hello all,

When a user selects a name from a combo box then 11 textboxes are populated with personal information.

What I am looking for is when the user edits the persons information (i.e. changes the persons phone number to a different number), how do I update the table with this information?

Is there a way to only update fields that have changed? or do I have to save all textboxes?

I have read about an "Update Query" and a SQL Update, but I did not think the two applied. I am sure that I am wrong, lol.

I tried the "Docmd.Runcommand acCmdSave (in the OnClick event cmd button) but it did not make any changes to the table.

This is what I put in the OnClick event:

Code:
Private Sub cmdSaveEdit_Click()
    DoCmd.RunCommand acCmdSave
    TextBoxLockDown
    Me.Requery
End Sub

Any help would be appreciated!

Sorry if this has been addressed somewhere, but I could not find exactly what I was looking for or maybe because I am so tired I could not see the answer which was probably in front of my nose this whole time.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 04:41
Joined
Jul 9, 2003
Messages
16,397
I suspect what you have now is a Combobox that has a row source which contains the personal information. When you select a name in the combobox, the Combobox afterupdate event is triggered and the information is extracted from the combobox row source in to the unbound text boxes. This is for display ONLY.

Two options spring to mind:-
Add a command button which uses the combobox value to open a form to the record in the table that supplies the Combo with its row source, edit the info there.

Seeing as you are permanently displaying info on your form in text boxes, replace this combobox and the textboxes with a subform.
 

magster06

Registered User.
Local time
Yesterday, 23:41
Joined
Sep 22, 2012
Messages
235
Uncle Gizmo,

Thank for your response and suggestions. I think I am going to try your first suggestion as I would like to keep my original form design.

Thanks again for explaining about the combo box.
 

Users who are viewing this thread

Top Bottom