Hi,
I can't seem to UPDATE existing data on my worksheet. The SEARCH and ADD NEW command buttons work great! However, I am creating a monitoring database and I really need the UPDATE command button to work since there will be a lot of changes to the data I previously inputted. Please help!
Heres the current code I have, It works fine for update; However, it doesn't automatically update the data on the worksheet.
You have to SELECT the 'NO.' of the row you want to update...the code I put in was the OFFSET FUNCTION.
Formula:
if MsgBox("Are you sure you wish to update this record?", vbYesNo, "Confirm update on datasheet") = vbYes Then
Worksheets("Datasheet").Activate
'For basic info
ActiveCell.Offset(0, 0).Value = frmProjects.TextBox55.Value
ActiveCell.Offset(0, 1).Value = frmProjects.TextBox1.Value
ActiveCell.Offset(0, 2).Value = frmProjects.TextBox2.Value
End If
'______________
With Me
'For basic info
frmProjects.TextBox55.Locked = True
frmProjects.TextBox1.Locked = True
frmProjects.TextBox2.Locked = True
End With
MsgBox "The record has sucessfully been updated", vbOKOnly
Unload Me
End Sub
Thats just part of the code! But theres around 40+ text boxes! i just need help on the basic framework of the code! Thank you!!
Bookmarks