how do i create a search result form from my userform data

relor

New Member
Joined
Mar 19, 2013
Messages
25
Private Sub AGENT_Change()


End Sub


Private Sub CLIENT_Change()


End Sub


Private Sub cmdAdd_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("INPUTS")


'''find first empty row in database
''iRow = ws.Cells(Rows.Count, 1) _
'' .End(xlUp).Offset(1, 0).Row
'revised code to avoid problems with Excel tables in newer versions
iRow = ws.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlValues).Row + 1


'check for a part number
If Trim(Me.STARTDATE.Value) = "" Then
Me.STARTDATE.SetFocus
MsgBox "Please enter a part number"
Exit Sub
End If


'copy the data to the database
ws.Cells(iRow, 1).Value = Me.STARTDATE.Value
ws.Cells(iRow, 2).Value = Me.ENDDATE.Value
ws.Cells(iRow, 3).Value = Me.CLIENT.Value
ws.Cells(iRow, 4).Value = Me.AGENT.Value
ws.Cells(iRow, 5).Value = Me.STATUS.Value
ws.Cells(iRow, 6).Value = Me.COUNT.Value
ws.Cells(iRow, 7).Value = Me.SENIOR.Value
ws.Cells(iRow, 8).Value = Me.D_I.Value
ws.Cells(iRow, 9).Value = Me.MONTHLY.Value
ws.Cells(iRow, 10).Value = Me.CONTACT.Value
ws.Cells(iRow, 11).Value = Me.STREET.Value
ws.Cells(iRow, 12).Value = Me.POSTAL.Value
ws.Cells(iRow, 13).Value = Me.FEEDBACK.Value
ws.Cells(iRow, 14).Value = Me.REMARKS.Value


'clear the data
Me.STARTDATE.Value = ""
Me.ENDDATE.Value = ""
Me.CLIENT.Value = ""
Me.AGENT.Value = ""
Me.STATUS.Value = ""
Me.COUNT.Value = ""
Me.SENIOR.Value = ""
Me.D_I.Value = ""
Me.MONTHLY.Value = ""
Me.CONTACT.Value = ""
Me.STREET.Value = ""
Me.POSTAL.Value = ""
Me.FEEDBACK.Value = ""
Me.REMARKS.Value = ""
Me.STARTDATE.SetFocus
End Sub


Private Sub cmdClose_Click()
Unload Me


End Sub






Private Sub CONTACT_Change()


End Sub


Private Sub COUNT_Change()


End Sub


Private Sub D_I_Change()


End Sub


Private Sub ENDDATE_Change()


End Sub


Private Sub FEEDBACK_Change()


End Sub


Private Sub MONTHLY_Change()


End Sub


Private Sub POSTAL_Change()


End Sub


Private Sub REMARKS_Change()


End Sub


Private Sub SENIOR_Change()


End Sub


Private Sub STARTDATE_Change()


End Sub


Private Sub STATUS_Change()


End Sub


Private Sub STREET_Change()


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
this is my userform scripts and it transfers data from userform to another sheet of excel..

my problem is how do i make a search query
that will display the previous data? on the same userform..

i just need to search the client then the info from userform will pop-up
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,214,990
Messages
6,122,626
Members
449,094
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top