Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HI all

Im noob to programing and i have a database in access with columns ID, Nps, Npp

what i need to do is. if i type a number listed on Npp column, i need to get as result the number on Nps.

i'm able to to this operation if instead of NPP i type the Id number. and as example the number on the NPP column are like this 8N5DHAFA1010++-1Y 100

the code that works using the id to to get the Nps value is the next

Me.DecoderBindingSource.Filter = "id = ' " & Me.TextBox4.Text & "'"

TextBox2.Text = NpsTextBox.Text

[EDIT]
The content comes from comment - Maciej Los

I have Visual studio 2008 and im using VB

Ok this is the code i have that is working, but on this database i have 3 columns a code that we create example: Column 1 ID, Column 2 Barcode, Column 3 CodS
in column 1 is the usual id from access
in column 2 we create a code that will identify and object " 622022 "
in column 3 we have the identification of the object " L6 CM602-2 T2 Z2R "
so if i scan the barcode on textbox 1 it will bring me on textbox 2 the Identification, and its working OK.

Now i want to do the same with a vendor part number " 8N5DHAFA1010++-1Y 100 " and bring the propetary part number "XXXXX-XXXXX"
but it does not work, it seems that only work with number and not all characters, im really lost, and im new to all this. hope that i explain myself.

Best regards
VB
Public Class Form1

    Private Sub DecoderBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DecoderBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.DecoderBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.ControldeMatDataSet)

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'ControldeMatDataSet.Decoder' table. You can move, or remove it, as needed.
        Me.DecoderTableAdapter.Fill(Me.ControldeMatDataSet.Decoder)

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.DecoderBindingSource.Filter = "Barcode = ' " & Me.TextBox1.Text & "'"
        TextBox2.Text = CodSTextBox.Text
    End Sub
End Class


[/EDIT]
Posted
Updated 24-Mar-14 20:53pm
v2
Comments
Maciej Los 23-Mar-14 18:08pm    
Unclear! Please, be more specific and provide more details.
What have you done till now? Where are you stuck?
VB? VB.NET? or VBA? Sounds like VBA!
temejin77 24-Mar-14 22:14pm    
--the content has been moved to the question---
temejin77 24-Mar-14 22:24pm    
--deleted---
temejin77 25-Mar-14 17:16pm    
Thank you is working now.

1 solution

Try to replace the filter line with this one:

VB
Me.DecoderBindingSource.Filter = "Barcode LIKE '*" & Me.TextBox1.Text & "*'"


See here how to use the filter:

http://msdn.microsoft.com/fr-fr/library/system.data.datacolumn.expression%28v=vs.110%29.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900