On 20 Apr 2007 07:22:37 -0700, (e-mail address removed) wrote:
¤ > ¤ > > On 18 Apr 2007 05:17:50 -0700, (e-mail address removed) wrote:
¤ > ¤ >
¤ > ¤ > > ¤ I am using a Access Database to search/add a bunch of information in
¤ > ¤ > > ¤ MS VB.net 2005 express. In the query (querybuilder) everything seems
¤ > ¤ > > ¤ right, but in the WHERE statement I use [Number] = me..textbox.text .
¤ > ¤ > > ¤
¤ > ¤ > > ¤ Then in the statement I have an if statement
¤ > ¤ > > ¤
¤ > ¤ > > ¤ IF combobox.text = option1 Then
¤ > ¤ > > ¤ e.databaseadapter.GetDataBy2() 'which is the query i built
¤ > ¤ > > ¤ end if
¤ > ¤ > > ¤
¤ > ¤ > > ¤ I get an error each time, and can't figure out if it iswith the sql
¤ > ¤ > > ¤ statement, or the execution. Is there a search critriafield i need
¤ > ¤ > > ¤ to put in place of me.textbox.text?
¤ > ¤ >
¤ > ¤ > > What is the error that is being generated? BTW, Number is aJet reserved word so it may not be a
¤ > ¤ > > good choice for a column name.
¤ > ¤ >
¤ > ¤ > > Paul
¤ > ¤ > > ~~~~
¤ > ¤ > > Microsoft MVP (Visual Basic)
¤ > ¤ >
¤ > ¤ > This is basicly the error I get.
¤ > ¤ >
¤ > ¤ >
http://img107.imageshack.us/img107/8965/vbcn6.jpg-Hidequoted text -
¤ > ¤ >
¤ > ¤ > - Show quoted text -
¤ > ¤
¤ > ¤ Any Ideas?
¤ >
¤ > Yes, the error indicates that one of the column names or criteria is not being recognized. I didn't
¤ > see your complete statement but it should look something like the following (assuming Number is a
¤ > numeric field):
¤ >
¤ > "WHERE [Number] = " & me.textbox.text
¤ >
¤ > In your example, me.textbox.text will not be evaluated until it is sent to the database engine
¤ > (which will have no clue as to what it is).
¤ >
¤ > Paul
¤ > ~~~~
¤ > Microsoft MVP (Visual Basic)
¤
¤ SELECT [Asset Tag Number], [User], Username, [Department Name],
¤ [Asset Name], [Asset Type], Catergory, [Serial Number], [Purchase
¤ Order Number],
¤ [Purchase Price], [Purchase Date], Warrenty,
¤ Notes
¤ FROM PPC_Inventory
¤ WHERE '[Asset Tag Number] =' & me.ToolStripTextBox1.[text]
¤ ORDER BY [Asset Tag Number]
¤
¤ is my query, in query builder. No luck still. any help?
Warranty is spelled incorrectly. Is that how it appears in the database table?
Paul
~~~~
Microsoft MVP (Visual Basic)