Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Userform VBA Complie Error: Method or data memeber not found

I have a userform and everything seems to be fine, however, I get this error
msg:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Method or data member not found
---------------------------
OK Help
---------------------------

I have checked everything and it appears to be ok, any suggestions please!!!
This is what I have....

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("ECSProductionLog")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a Name
If Trim(Me.txtName.Value) = "" Then
Me.txtName.SetFocus
MsgBox "Please enter a name"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 9).Value = Me.txtName.Value
ws.Cells(iRow, 1).Value = Me.txtDailyProductionFrontEnd.Value
ws.Cells(iRow, 2).Value = Me.txtDailyProductionBackEnd.Value
ws.Cells(iRow, 3).Value = Me.txtMeeting.Value
ws.Cells(iRow, 4).Value = Me.txtHoliday.Value
ws.Cells(iRow, 5).Value = Me.txtVacation.Value
ws.Cells(iRow, 6).Value = Me.txtPersonal.Value
ws.Cells(iRow, 7).Value = Me.txtSick.Value
ws.Cells(iRow, 8).Value = Me.txtOther.Value


'clear the data
Me.txtName = ""
Me.txtDailyProductionFrontEnd.Value = ""
Me.txtDailyProductionBackEnd.Value = ""
Me.txtMeeting.Value = ""
Me.txtHoliday.Value = ""
Me.txtVacation.Value = ""
Me.txtPersonal.Value = ""
Me.txtSick.Value = ""
Me.txtOther.Value = ""
Me.txtName.SetFocus
____________________________________________
End Sub
Private Sub cmdClose_Click()
Unload Me
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
____________________________________________
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Userform VBA Complie Error: Method or data memeber not found

Hi,

It would have helped if you said which line wasn't compiling.

This code compiles fine for me but it will fall over with the message you
describe if you don't have textboxes with the same names as in the code. If
it is falling over on one of those lines check for typos in either the code
or the textbox name on the userform. They must all have a match.

Mike



"mrvento" wrote:

I have a userform and everything seems to be fine, however, I get this error
msg:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Method or data member not found
---------------------------
OK Help
---------------------------

I have checked everything and it appears to be ok, any suggestions please!!!
This is what I have....

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("ECSProductionLog")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a Name
If Trim(Me.txtName.Value) = "" Then
Me.txtName.SetFocus
MsgBox "Please enter a name"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 9).Value = Me.txtName.Value
ws.Cells(iRow, 1).Value = Me.txtDailyProductionFrontEnd.Value
ws.Cells(iRow, 2).Value = Me.txtDailyProductionBackEnd.Value
ws.Cells(iRow, 3).Value = Me.txtMeeting.Value
ws.Cells(iRow, 4).Value = Me.txtHoliday.Value
ws.Cells(iRow, 5).Value = Me.txtVacation.Value
ws.Cells(iRow, 6).Value = Me.txtPersonal.Value
ws.Cells(iRow, 7).Value = Me.txtSick.Value
ws.Cells(iRow, 8).Value = Me.txtOther.Value


'clear the data
Me.txtName = ""
Me.txtDailyProductionFrontEnd.Value = ""
Me.txtDailyProductionBackEnd.Value = ""
Me.txtMeeting.Value = ""
Me.txtHoliday.Value = ""
Me.txtVacation.Value = ""
Me.txtPersonal.Value = ""
Me.txtSick.Value = ""
Me.txtOther.Value = ""
Me.txtName.SetFocus
____________________________________________
End Sub
Private Sub cmdClose_Click()
Unload Me
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
____________________________________________

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Userform VBA Complie Error: Method or data memeber not found

Hi,

here it is:

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("ECSProductionLog")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row


'check for a Name
If Trim(Me.txtName.Value) = "" Then <<<<<<<<<<< HERE
Me.txtName.SetFocus
MsgBox "Please enter a name"
Exit Sub
End If



"Mike H" wrote:

Hi,

It would have helped if you said which line wasn't compiling.

This code compiles fine for me but it will fall over with the message you
describe if you don't have textboxes with the same names as in the code. If
it is falling over on one of those lines check for typos in either the code
or the textbox name on the userform. They must all have a match.

Mike



"mrvento" wrote:

I have a userform and everything seems to be fine, however, I get this error
msg:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Method or data member not found
---------------------------
OK Help
---------------------------

I have checked everything and it appears to be ok, any suggestions please!!!
This is what I have....

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("ECSProductionLog")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a Name
If Trim(Me.txtName.Value) = "" Then
Me.txtName.SetFocus
MsgBox "Please enter a name"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 9).Value = Me.txtName.Value
ws.Cells(iRow, 1).Value = Me.txtDailyProductionFrontEnd.Value
ws.Cells(iRow, 2).Value = Me.txtDailyProductionBackEnd.Value
ws.Cells(iRow, 3).Value = Me.txtMeeting.Value
ws.Cells(iRow, 4).Value = Me.txtHoliday.Value
ws.Cells(iRow, 5).Value = Me.txtVacation.Value
ws.Cells(iRow, 6).Value = Me.txtPersonal.Value
ws.Cells(iRow, 7).Value = Me.txtSick.Value
ws.Cells(iRow, 8).Value = Me.txtOther.Value


'clear the data
Me.txtName = ""
Me.txtDailyProductionFrontEnd.Value = ""
Me.txtDailyProductionBackEnd.Value = ""
Me.txtMeeting.Value = ""
Me.txtHoliday.Value = ""
Me.txtVacation.Value = ""
Me.txtPersonal.Value = ""
Me.txtSick.Value = ""
Me.txtOther.Value = ""
Me.txtName.SetFocus
____________________________________________
End Sub
Private Sub cmdClose_Click()
Unload Me
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
____________________________________________

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Userform VBA Complie Error: Method or data memeber not found

Hi,

Then I now strongly suspect that you don't have a textbox on your userform
called

txtName

Double check that you have, the spellimg must be exact

Mike

"mrvento" wrote:

Hi,

here it is:

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("ECSProductionLog")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row


'check for a Name
If Trim(Me.txtName.Value) = "" Then <<<<<<<<<<< HERE
Me.txtName.SetFocus
MsgBox "Please enter a name"
Exit Sub
End If



"Mike H" wrote:

Hi,

It would have helped if you said which line wasn't compiling.

This code compiles fine for me but it will fall over with the message you
describe if you don't have textboxes with the same names as in the code. If
it is falling over on one of those lines check for typos in either the code
or the textbox name on the userform. They must all have a match.

Mike



"mrvento" wrote:

I have a userform and everything seems to be fine, however, I get this error
msg:

---------------------------
Microsoft Visual Basic
---------------------------
Compile error:

Method or data member not found
---------------------------
OK Help
---------------------------

I have checked everything and it appears to be ok, any suggestions please!!!
This is what I have....

Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet

Set ws = Worksheets("ECSProductionLog")

'find first empty row in database
iRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

'check for a Name
If Trim(Me.txtName.Value) = "" Then
Me.txtName.SetFocus
MsgBox "Please enter a name"
Exit Sub
End If

'copy the data to the database
ws.Cells(iRow, 9).Value = Me.txtName.Value
ws.Cells(iRow, 1).Value = Me.txtDailyProductionFrontEnd.Value
ws.Cells(iRow, 2).Value = Me.txtDailyProductionBackEnd.Value
ws.Cells(iRow, 3).Value = Me.txtMeeting.Value
ws.Cells(iRow, 4).Value = Me.txtHoliday.Value
ws.Cells(iRow, 5).Value = Me.txtVacation.Value
ws.Cells(iRow, 6).Value = Me.txtPersonal.Value
ws.Cells(iRow, 7).Value = Me.txtSick.Value
ws.Cells(iRow, 8).Value = Me.txtOther.Value


'clear the data
Me.txtName = ""
Me.txtDailyProductionFrontEnd.Value = ""
Me.txtDailyProductionBackEnd.Value = ""
Me.txtMeeting.Value = ""
Me.txtHoliday.Value = ""
Me.txtVacation.Value = ""
Me.txtPersonal.Value = ""
Me.txtSick.Value = ""
Me.txtOther.Value = ""
Me.txtName.SetFocus
____________________________________________
End Sub
Private Sub cmdClose_Click()
Unload Me
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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 461-Method or data member not found shorticake Excel Programming 3 November 15th 07 03:42 PM
Compile error: Method or data member not found Brian Day Excel Programming 3 July 25th 07 02:06 AM
Compile Error: Method or Data Member not found Harimau Excel Programming 2 July 3rd 07 12:18 AM
Compile Error: Method or data member not found Nick S[_4_] Excel Programming 0 November 16th 04 04:43 PM
Compile Error: Method or data member not found Nick S[_3_] Excel Programming 2 November 16th 04 02:38 PM


All times are GMT +1. The time now is 03:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"