Hi aydeegee,
Thanks for the reply, ya im open to any suggestions
here is my code for poplating the textboxes
Private Sub txtEditProductID_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim Search As String
Dim target As Range
Search = txtEditProductID.Value
Worksheets("PRODUCT").Activate
Set target = Sheets("PRODUCT").Cells.Find(What:=Search, LookIn:=xlFormulas, lookat:=xlWhole)
If target Is Nothing Then
MsgBox "Item does not Exist"
txtEditProductID = ""
txtEditID = ""
txtEditUPC = ""
txtEditCategory = ""
txtEditName = ""
txtEditProductInformationIE = ""
txtEditProductInformationNI = ""
txtEditUnitPriceIE = ""
txtEditUnitPriceNI = ""
txtEditManufacturer = ""
txtEditWidth = ""
txtEditDepth = ""
txtEditHeight = ""
txtEditFront_0 = ""
txtEditLeft_0 = ""
txtEditMax_High = ""
txtEditProductID.SetFocus
Else
txtEditID.text = target.Offset(0, 1).Value
txtEditUPC.text = target.Offset(0, 4).text
txtEditCategory.text = target.Offset(0, 3).Value
txtEditName.text = target.Offset(0, 5).text
txtEditProductInformationIE.text = target.Offset(0, 6).text
txtEditProductInformationNI.text = target.Offset(0, 7).text
txtEditUnitPriceIE.text = target.Offset(0, 12).text
txtEditUnitPriceNI.text = target.Offset(0, 13).text
txtEditManufacturer.text = target.Offset(0, 16).text
txtEditWidth.text = target.Offset(0, 17).text
txtEditDepth.text = target.Offset(0, 18).text
txtEditHeight.text = target.Offset(0, 19).text
txtEditFront_0.text = target.Offset(0, 20).text
txtEditLeft_0.text = target.Offset(0, 21).text
txtEditMax_High.text = target.Offset(0, 22).text
End If
End Sub
And then here is the code for the command button (Add Details)
Private Sub cmdAddDetails_Click()
Dim lngwriterow As Long 'Declaring the Variable
Dim ws As Worksheet
Set ws = Worksheets("PRODUCT") 'Any Information written in will be sent to the worksheet (Product)
lngwriterow = ws.Cells(Rows.Count, 2) _
.End(xlUp).Offset(1, 0).Row 'Will go to the last figure entered in the worksheet (Product) and skip a row for new data to be entered
If lngwriterow < 13 Then lngwriterow = 13
ws.Range("A" & lngwriterow) = txtEditProductID.Value 'The data entered in the textbox named ProductID will be sent to column A in the next free row available
ws.Range("B" & lngwriterow) = txtEditID.Value 'The data entered in the textbox named ID will be sent to column B in the next free row available
ws.Range("E" & lngwriterow) = txtEditUPC.Value 'The data entered in the textbox named UPC will be sent to column D in the next free row available
ws.Range("D" & lngwriterow) = txtEditCategory.Value 'The data entered in the textbox named Category will be sent to column C in the next free row available
ws.Range("F" & lngwriterow) = txtEditName.Value 'The data entered in the textbox named Name will be sent to column E in the next free row available
ws.Range("G" & lngwriterow) = txtEditProductInformationIE.Value 'The data entered in the textbox named ProductInfoIE will be sent to column F in the next free row available
ws.Range("H" & lngwriterow) = txtEditProductInformationNI.Value 'The data entered in the textbox named ProductInfoNI will be sent to column G in the next free row available
Me.MultiPage1.Value = 1
End Sub
Thanks Again
Bookmarks