Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
USERFORM's
I am using EXCEL for MAC. I wrote a userform to enter data into a database
but everytime I put in a new entry the prvious entry is deleted. Here is the code to see where I am going wrong. Private Sub CommandButton1_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("Comic Collection") iRow = ws.Cells(Rows.Count, 1) _ .End(xlUp).Offset(1, 0).Row If Trim(Me.TextBook_Name.Value) = "" Then Me.TextBook_Name.SetFocus MsgBox "Please enter a Comic Name" Exit Sub End If ws.Cells(iRow, 1).Value = Me.TextBook_Name.Value ws.Cells(iRow, 2).Value = Me.TextPublisher.Value ws.Cells(iRow, 3).Value = Me.TextImprint.Value ws.Cells(iRow, 4).Value = Me.TextSeries_Began.Value ws.Cells(iRow, 5).Value = Me.TextSeries_Ended.Value ws.Cells(iRow, 6).Value = Me.TextFirst_Issue.Value ws.Cells(iRow, 7).Value = Me.TextLast_Issue.Value ws.Cells(iRow, 8).Value = Me.TextFormat.Value ws.Cells(iRow, 9).Value = Me.TextCountry.Value ws.Cells(iRow, 10).Value = Me.TextLanguage.Value ws.Cells(iRow, 11).Value = Me.TextIssue_Number.Value End Sub Private Sub CommandButton2_Click() Unload Me End Sub Private Sub TextBox1_Change() End Sub Private Sub UserForm_QueryClose(Cancel As Integer, _ CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "Please use the button!" End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to find UserForm's caller? | Excel Discussion (Misc queries) | |||
Set UserForm's HelpContextID with Designer | Excel Programming | |||
How to control the UserForm's position? | Excel Programming | |||
RunTime Error 424 in a USERFORM's code | Excel Programming |