Hello all,
I've set up a userform within VBA, however, when I attempt to call it using the command button I receive a "Compile Error: Method or data member not found" error. The portion of the code that is highlighted is the .Show portion. I've added the code to call on the userform as well as the code that would enter the information put in to the user form into the worksheet I've designated as the data sheet. Here's the call code:
Here's the code that would enter the data in to the worksheet once the fields have been filled. I've been unable to test this as I haven't been able to have the userform appear when the command button is clicked on.
I appreciate any help anyone can give me on this. Thank you.
Damian
I've set up a userform within VBA, however, when I attempt to call it using the command button I receive a "Compile Error: Method or data member not found" error. The portion of the code that is highlighted is the .Show portion. I've added the code to call on the userform as well as the code that would enter the information put in to the user form into the worksheet I've designated as the data sheet. Here's the call code:
VBA Code:
Private Sub CommandButton1_Click()
RecordEntryForm.Show
End Sub
Code:
Private Sub UserForm_Click()
Dim lRow As Long
Dim lPart As Long
Dim WS As Worksheet
Set WS = Worksheets("AllData")
lRow = WS.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1
RecordEntryForm.Show
With WS
.Cells(lRow, 1).Value = Me.StoreID.Value
.Cells(lRow, 2).Value = Me.Division.Value
.Cells(lRow, 3).Value = Me.Region.Value
.Cells(lRow, 4).Value = Me.Storetype.Value
.Cells(lRow, 5).Value = Me.Storestatus.Value
.Cells(lRow, 6).Value = Me.DateVerify.Value
.Cells(lRow, 7).Value = Me.StorePOC.Value
.Cells(lRow, 8).Value = Me.POCEmail.Value
.Cells(lRow, 9).Value = Me.StoreMgr.Value
.Cells(lRow, 10).Value = Me.MgrEmail.Value
.Cells(lRow, 11).Value = Me.QHContact.Value
.Cells(lRow, 12).Value = Me.QHEmail.Value
.Cells(lRow, 13).Value = Me.DistroBP.Value
.Cells(lRow, 14).Value = Me.CloseDate.Value
.Cells(lRow, 15).Value = Me.RSAName.Value
.Cells(lRow, 16).Value = Me.RSAEmail.Value
.Cells(lRow, 17).Value = Me.ASMName.Value
.Cells(lRow, 18).Value = Me.ASMEmail.Value
.Cells(lRow, 19).Value = Me.ROMName.Value
.Cells(lRow, 20).Value = Me.ROMEmail.Value
.Cells(lRow, 21).Value = Me.FMMName.Value
.Cells(lRow, 22).Value = Me.FMMEmail.Value
.Cells(lRow, 23).Value = Me.BPContact.Value
.Cells(lRow, 24).Value = Me.City.Value
.Cells(lRow, 25).Value = Me.State.Value
.Cells(lRow, 26).Value = Me.BrandedPartner.Value
.Cells(lRow, 27).Value = Me.PartnerPM.Value
.Cells(lRow, 28).Value = Me.PMEmail.Value
End With
End Sub
Damian