Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27033

[RESOLVED] BindingSource.Filter

$
0
0
Can anyone tell me why this filter does not work.

1) ProgramID field in the Bid table is a FK col. to a table called IDPrograms.
2) IDPrograms tables PK col is ProgramID but is not a autonum or a num field at all (I don't know why) I did not create this db. It is a text field

Here's my code, but I get the error: cannot find column "ProgramName". ProgramName is replace with the cmbPrograms.selectedvalue

Code:

Private Sub cmbProgram_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cmbProgram.SelectedIndexChanged

        Dim ProgramName As String
        ProgramName = cmbProgram.SelectedValue
        BidBindingSource.Filter = String.Format("ProgramID =" & ProgramName & " AND Archived = False")

    End Sub

This exact code works with integers like selected indexs, or where the damn ID field is actually a integer.
Maybe you need more info but can anyone help me.

Viewing all articles
Browse latest Browse all 27033

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>