I downloaded an excel file that demonstrated the use of a userform inserting, deleting, and editing records in a database. When I activated the code in the file that I downloaded, all worked well. I had another project that I am working on and this looked like the perfect code that I needed to perform the above in my file. After copying the code from the downloaded file to my module (and not having it to work) and then typing in the code, and still not having it to work, I decided it was time I seeked help from the masters. The following is the subroutine I have been trying to call.
Sub GetData()
With Me
.TextA = Range("Database").Cells(iRowNumber, 1)
.TextB = Range("Database").Cells(iRowNumber, 2)
.TextC = Range("Database").Cells(iRowNumber, 3)
.TextD = Range("Database").Cells(iRowNumber, 4)
End With
End Sub
When the above sub is called, I always receive the error: Run-time error '1004'
Application-defined or object-defined error.
Oh yes, by the way, my module begins with...
Option Explicit
Dim iRowNumber As Integer.
I have checked spelling, and everything seems to correspond with the downloaded file, but I keep getting the error.
Any help would be greatly appreciated.
MrBaldGuy
Sub GetData()
With Me
.TextA = Range("Database").Cells(iRowNumber, 1)
.TextB = Range("Database").Cells(iRowNumber, 2)
.TextC = Range("Database").Cells(iRowNumber, 3)
.TextD = Range("Database").Cells(iRowNumber, 4)
End With
End Sub
When the above sub is called, I always receive the error: Run-time error '1004'
Application-defined or object-defined error.
Oh yes, by the way, my module begins with...
Option Explicit
Dim iRowNumber As Integer.
I have checked spelling, and everything seems to correspond with the downloaded file, but I keep getting the error.
Any help would be greatly appreciated.
MrBaldGuy