So it's this statement where it complains, right:
string filter = "State = '" + dlg.stateTextBox.Text + "'";
It sounds like the stateTextBox control on the dialog doesn't have the public modifier. I would double check that. Be sure it's set to "public" or "internal" not "protected" or something else.
If that doesn't work, post here again and we'll look more closely at the issue. Off hand I can't think why else you would be getting that error here.