I am not a professional programmer, but have learnt programming out of my interest. I have been working with foxpro at expert level and VB at very basic level. Now a days i am working on Excel. In that I am trying to create a userform which should do following.
1. Extract a particular record from a table and display chosen information. (This has been achieved)
2. based on one of the extracted fields, I want to identify records, through an existing pivot table and create checkboxes based on number of matching records. (I have been able to select the existing table with specific filter, create the checkboxes as per number of records. But I am unable to do it through dynamic filter.)
I am using following codes for specific filter.

Dim erowG, tp, x As Integer
Dim opt As Control
Dim myAuditor As String
myAuditor = txtAuditType.Text
msgbox myAuditor, vbOKOnly (It is giving me desired result)
'initialize first variable position
tp = 45
'declare variable list end of row
Worksheets("Pivot Tables for Forms").Activate

ActiveSheet.PivotTables("pvtAuditType").PivotFields("Qualification"). _
ActiveSheet.PivotTables("pvtAuditType").PivotFields("Qualification"). _
CurrentPage = "CPI" (When I replace "CPI" with myAuditor, i get runtime error 1004)

erowG = Worksheets("Pivot Tables for Forms").PivotTables("PivotTable6").RowRange.Count - 1

msgbox (erowG & FirstName), vbOKOnly

For x = 1 To erowG
Set opt = frmScheduleAudit.Controls.Add("forms.CheckBox.1", "Checkbox" & x, True)
opt.Caption = "checkbox" & x
opt.Width = 70
opt.Height = 18
opt.Left = 18
opt.Top = tp
tp = tp + 20


cmdUpdate.Caption = "Update"
cmdUpdate.Accelerator = "U"