ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Form for updating records (https://www.excelbanter.com/excel-programming/415803-excel-form-updating-records.html)

terry

Excel Form for updating records
 
Hi Guys
I need a form to let me update records in Excel 2002 I have a form thats
lets me enter a new record see code below but I don't know how to update the
records I have entered already
As you can see I can't use the Automatic form ie Data Forms, Excel gives
me as I have two combo boxes on it
Also I would like to use the scroll option to scroll through these records
Thanks so much Terry

Private Sub CommandButton1_Click()
Dim LastRow As Object

Set LastRow = Sheet1.Range("a65536").End(xlUp)

LastRow.Offset(1, 0).Value = Program.Text
LastRow.Offset(1, 2).Value = Catagory.Text
LastRow.Offset(1, 3).Value = Description.Text
LastRow.Offset(1, 4).Value = DiskType.Text
LastRow.Offset(1, 5).Value = DiskNumber.Text
LastRow.Offset(1, 6).Value = BackupDrive.Text
LastRow.Offset(1, 7).Value = Version.Text
LastRow.Offset(1, 8).Value = DiskName.Text
LastRow.Offset(1, 9).Value = Key.Text
LastRow.Offset(1, 10).Value = Note.Text



MsgBox "One record written to Software"

response = MsgBox("Do you want to enter another record?", _
vbYesNo)

If response = vbYes Then
Program.Text = ""
Catagory.Text = ""
Description.Text = ""
DiskType.Text = ""
DiskNumber = ""
BackupDrive.Text = ""
Version.Text = ""
DiskName.Text = ""
Key.Text = ""
Note.Text = ""


Program.SetFocus

Else
Unload Me
End If


End Sub



All times are GMT +1. The time now is 12:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com