hi,
try to remove single quote( ') in your selection formula like this :

Code:
crtDistribute.SelectionFormula = "{tblDistribute.DistributeID}= " & txtDistributeID.Text