bjfulkerson
asked on
Update existing record from Userform
I have an existing table that I want to be able to update the records if needed.
It is in a UseForm
How can I do that?
It is in a UseForm
How can I do that?
Which table do you want to update?
ASKER
EmployeeName
Have you created a separate form for that?
I ask because the form in the workbook you attached previously seemed to be for updating a different table/sheet.
PS Could you upload your current workbook?
I ask because the form in the workbook you attached previously seemed to be for updating a different table/sheet.
PS Could you upload your current workbook?
In the UpdateEmployeeEntry userform. There don't see to be input fields for the two with "???".
Private Sub ccmdAdd_Click()
Dim lastrow As Long
With Sheets("EmployeeName")
lastrow = .Range("A1048576").End(xlUp).Row
.Cells(lastrow + 1, "A").Value = TextBox1.Text
.Cells(lastrow + 1, "B").Value = TextBox8.Text
.Cells(lastrow + 1, "C").Value = TextBox9.Text
.Cells(lastrow + 1, "D").Value = TextBox10.Text
'.Cells(lastrow + 1, "E").Value = ???
.Cells(lastrow + 1, "G").Value = TextBox3.Text
'.Cells(lastrow + 1, "H").Value = ???
End With
End Sub
Martin
Where did you get the code from?
Where did you get the code from?
His previous question that I solved for him.
Well I'll bow out of this one obviously didn't help the questioner in my previous responses.:)
ASKER
Please don't imnorie.
I added to Timesheet and I want to beable to add or update EmployeeName.
STL-Function-Analysis-2015-V2.xlsm
I added to Timesheet and I want to beable to add or update EmployeeName.
STL-Function-Analysis-2015-V2.xlsm
Did you try the code I posted above?
ASKER
I got this to work. I needed to add the list index to the combo box.
Now I just want to edit and update and not create an additional record
Now I just want to edit and update and not create an additional record
In order to update an employee record, one needs to be selected first, and I believe the best way to do that would be to have the "Show Employee Add or Update" button on the EmployeeName sheet rather than the Home sheet. Is that acceptable?
ASKER
I am using the list index to populate the Show employee Add or Update userform. If the information is already in the useform can I change it and re write the new info back to the table?
I am using the list index to populate the Show employee Add or Update userform.Huh? The only way I see to show that userform is by clicking the "Show Employee Add or Update" button that's on the EmployeeName sheet.
ASKER
My version it's on the Home sheet
Now I'm totally confused because in a post above you said
but as far as I can see there is no combobox or listbox associated with that userform, so what list index are you talking about?
I am using the list index to populate the Show employee Add or Update userform. If the information is already in the useform can I change it and re write the new info back to the table?
but as far as I can see there is no combobox or listbox associated with that userform, so what list index are you talking about?
ASKER
This is my current file
STL-Function-Analysis-2015-V2.xlsm
STL-Function-Analysis-2015-V2.xlsm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is perfect!
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for bjfulkerson's comment #a40515099
for the following reason:
Excellent
Accepted answer: 0 points for bjfulkerson's comment #a40515099
for the following reason:
Excellent
I believe that the Asker meant to give the points to me.
You're welcome and I'm glad I was able to help.
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2014
ASKER
Thanks Martin