cyberbob999
Technical User
I'm trying to filter my recordset using a combobox. This seems like it should be an easy task to me, but I can't make it work. I've followed various examples in this forum, but I can't get any of them to work. Can someone please point out what I'm doing wrong?
This is what I've tried:
[filPerformer] is the combo box
I just have the "msgbox filname" in there as a debugging tool to make sure filname is being assigned the right name, and it is.
Private Sub FilPerformer_AfterUpdate()
filname = DLookup("[performer]", "List of Surveillance Performers", "[IDnumber] = Forms![edit_surv]! _[FilPerformer]"
MsgBox filname
Me.Filter = "[performer] like" & filname
Edit_Surv.FilterOn = True
End Sub
When I run it shown above, I get : "You can't assign a value to this object"
I also tried:
a few variations of this:
Private Sub FilPerformer_AfterUpdate()
filname = DLookup("[performer]", "List of Surveillance_ Performers", "[IDnumber] = Forms![edit_surv]![FilPerformer]"
MsgBox filname
Me.Filter = "[performer] = filname"
Me.FilterOn = True
End Sub
Again, filname is being assigned the right value, but when I update the combo box I am prompted with an "Enter paramet value window" for "filname." I don't understand why the function is not recognizing the variable I already have established???
also, the reason I am doing the DLookup is because when I change the combobox FilPerformer, FilPerformer returns the IDnumber associated with the name I selected.
I am tired of banging my head against the wall--please help :*(
Oh, and I've tried to access Bill Power's site to download his filterforms example, but I haven't been able to connect to it for the past 3 days (I have connected in the past, so I don't know what the deal is!)
This is what I've tried:
[filPerformer] is the combo box
I just have the "msgbox filname" in there as a debugging tool to make sure filname is being assigned the right name, and it is.
Private Sub FilPerformer_AfterUpdate()
filname = DLookup("[performer]", "List of Surveillance Performers", "[IDnumber] = Forms![edit_surv]! _[FilPerformer]"
MsgBox filname
Me.Filter = "[performer] like" & filname
Edit_Surv.FilterOn = True
End Sub
When I run it shown above, I get : "You can't assign a value to this object"
I also tried:
a few variations of this:
Private Sub FilPerformer_AfterUpdate()
filname = DLookup("[performer]", "List of Surveillance_ Performers", "[IDnumber] = Forms![edit_surv]![FilPerformer]"
MsgBox filname
Me.Filter = "[performer] = filname"
Me.FilterOn = True
End Sub
Again, filname is being assigned the right value, but when I update the combo box I am prompted with an "Enter paramet value window" for "filname." I don't understand why the function is not recognizing the variable I already have established???
also, the reason I am doing the DLookup is because when I change the combobox FilPerformer, FilPerformer returns the IDnumber associated with the name I selected.
I am tired of banging my head against the wall--please help :*(
Oh, and I've tried to access Bill Power's site to download his filterforms example, but I haven't been able to connect to it for the past 3 days (I have connected in the past, so I don't know what the deal is!)