wot should i do?

1jet

Registered User.
Local time
Tomorrow, 06:38
Joined
Sep 15, 2008
Messages
117
hi all
i have a form (frmEditEmployee) used to edit employee details.
the record source being
SELECT tblEmployee.* FROM tblEmployee WHERE (((tblEmployee.[Employee ID])=Forms!frmEditEmployee!cboEmployeeID));

when an employee is chosen from the top combo box "cboEmployeeID," the rest of the text fields populate accordingly.

what's the best way to save this data back to "tblEmployee" once changes are made? right now two of my attempts below have failed

1. my macro with action "save" to table tblEmployee comes up with an error message
2. is there a simple update query i can use?

thanks!
 
If that's the record source of the form, you shouldn't have to do anything. Changes should automatically be reflected in the table.
 
If that's the record source of the form, you shouldn't have to do anything. Changes should automatically be reflected in the table.


You're right.

So that also saves me time with my "Save & Close" button. All I have to do is have that button close the form and the changes will update the table.

How about my other "Close" button? Where I don't want the changes updated, but just the form closed?

And my other "Save" button? Where I want the changes saved, but the form cleared for another change of employee details?
 
For the first, look at Undo in VBA help. For the second, just go to a new record, which will automatically save any changes made to the current record.
 
For the first, look at Undo in VBA help. For the second, just go to a new record, which will automatically save any changes made to the current record.


For the first, I'll look into VBA help. I thought there would be an undo action in the list of macro actions. Couldn't find any.

For the second, I've come up with something nicer. I've made a macro with actions...
1. save (just in case it decides to work)
2. setvalue (cboEmployeeID = "")
3. requery
which works nicely where it will save the changes PLUS clears the form ready for another change of employee details
 
I don't use macros, but Undo is under RunCommand.
 

Users who are viewing this thread

Back
Top Bottom