Hi,
I have CommandButton2 & CommandButton3 on a MultiPage Control on a Form. Since the form is quite large, somtimes a user does not have to enter info for all of them. What I want to do is have Commandbutton3 which is on page 2 of multipage control update the worksheet the same way CommandButton2(page4)would. A sample of my code follows. I have left out some since the coding is a lot.
Dim Lastrow as object
Set LastRow = Sheet1.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = Polno.Text
LastRow.Offset(1, 1).Value = Claimno.Text
Click CommandButton2 and get the following.
MsgBox "One record written to Marine Claims"
response = MsgBox("Do you want to add another record?", _
vbYesNo)
If response = vbYes Then
Polno.Text = ""
Claimno.Text = ""
MultiPage1.Value = 0
Polno.SetFocus
Else
For Each w In Application.Workbooks
w.Save
Next w
Application.Quit
End If
End Sub
Any help would be appreciated.
Mareene
I have CommandButton2 & CommandButton3 on a MultiPage Control on a Form. Since the form is quite large, somtimes a user does not have to enter info for all of them. What I want to do is have Commandbutton3 which is on page 2 of multipage control update the worksheet the same way CommandButton2(page4)would. A sample of my code follows. I have left out some since the coding is a lot.
Dim Lastrow as object
Set LastRow = Sheet1.Range("a65536").End(xlUp)
LastRow.Offset(1, 0).Value = Polno.Text
LastRow.Offset(1, 1).Value = Claimno.Text
Click CommandButton2 and get the following.
MsgBox "One record written to Marine Claims"
response = MsgBox("Do you want to add another record?", _
vbYesNo)
If response = vbYes Then
Polno.Text = ""
Claimno.Text = ""
MultiPage1.Value = 0
Polno.SetFocus
Else
For Each w In Application.Workbooks
w.Save
Next w
Application.Quit
End If
End Sub
Any help would be appreciated.
Mareene