Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a Filter in VB (VS2008)

Status
Not open for further replies.

KiaKia

Programmer
Mar 30, 2008
59
US
Hi,
Please let me know how can I pass e variable to a Filter string in VB (VS2008).
I tried the following, based on what I used to do in VBA but it does not work.

'Me.SpecTypeBindingSource.Filter = "CPTypeID=" & MyVar
 
Try

Me.SpecTypeBindingSource.Filter = "CPTypeID = '" & MyVar & "'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top