All,
Thank you for your help. I got it to work but I got the help from AlphaFrog's link because I did notice a few flaws in MB's code.
Option Explicit
Sub loadChanges()
Dim projName As String, dateSub As Variant, requestBy As String, changeNum As String,
Dim changeType As String, changeReq As Variant, projDesc as variant, projName as variant, origCost as currency, lineItem As Integer, FindAddress As String, x As Long, sFind As Variant, lRowFnd As Variant
Dim dataSheet As Worksheet
Set dataSheet = ActiveWorkbook.Worksheets("Database")
sFind = requestForm.tbID.Value
With dataSheet
Set R = .Cells(1, 2).EntireColumn.Find(sFind)
If Not R Is Nothing Then
FindAddress = R.Address
x = 1
Do
lineItem = x
lRowFnd = R.Row
'Required
changeNum = .Cells(lRowFnd, 2)
requestBy = .Cells(lRowFnd, 4)
dateSub = .Cells(lRowFnd, 5)
changeType = .Cells(lRowFnd, 6)
'Project Information
changeReq = .Cells(lRowFnd, 7)
projDesc = .Cells(lRowFnd, 9)
projName = .Cells(lRowFnd, 10)
origCost = .Cells(lRowFnd, 11)
If sFind = changeNum And lineItem = 1 Then
'Required
requestForm.tbChangeNum.Value = changeNum
requestForm.tbDate.Value = dateSub
requestForm.cbChangeType.Value = changeType
requestForm.tbUserName.Value = requestBy
'Project Information
requestForm.tbDesc.Value = projDesc
requestForm.tbProjName.Value = projName
requestForm.tbCost.Value = origCost
requestForm.tbCost.Value = Application.WorksheetFunction.Dollar(requestForm.tbCost.Value, 2)
ElseIf sFind = changeNum And lineItem = 2 Then
requestForm.MultiPage2.Pages(1).Visible = True
requestForm.tbProjDescSD.Value = projDesc
requestForm.tbCostSD.Value = origCost
requestForm.tbCostSD.Value = Application.WorksheetFunction.Dollar(requestForm.tbCostSD.Value, 2)
requestForm.tbProjNameSD.Value = projName
requestForm.tbChType1.Value = changeReq
End If
x = x + 1
Set R = .Cells(1, 2).EntireColumn.FindNext(R)
Loop While Not R Is Nothing And R.Address <> FindAddress
End If
End With
Set R = Nothing
Thank you again!! I will mark this as solved.
Bookmarks