bartsan
asked on
Button in VB6 and sql statement to Access XL
Hi All,
I have an Access table and I would like to search for datas matching a certain input field in a Visual Basic 6 form.
Name of the table is A with a1 to a4 as the column names. I've created a data environment and within a command which has the following sql statement
SELECT a1, a2, a3 FROM a WHERE (a2 LIKE inputField)
Unfortunately do I have problems to connect this to a button in VB.
It would be ideal if the result could be stored in another table but I do not know how.
Whenever I run the above command with an exact value like for instance 'test' everything is okay but it doesn't get the variable form the input field. Any idea where the bug is?
Thank you for your support
Kind regards Andreas
I have an Access table and I would like to search for datas matching a certain input field in a Visual Basic 6 form.
Name of the table is A with a1 to a4 as the column names. I've created a data environment and within a command which has the following sql statement
SELECT a1, a2, a3 FROM a WHERE (a2 LIKE inputField)
Unfortunately do I have problems to connect this to a button in VB.
It would be ideal if the result could be stored in another table but I do not know how.
Whenever I run the above command with an exact value like for instance 'test' everything is okay but it doesn't get the variable form the input field. Any idea where the bug is?
Thank you for your support
Kind regards Andreas
I'm not sure what you're doing between VB and Access, but make sure your syntax is correct - ";" at the end, quotes in the right places, things like that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Alan,
thanks for the answer.
What I miss now is the next step, connecting it to the data environment. I've used the properties window to add tables or sql statements to the commands but with a variable is this probably impossible. I am new to VB and the MS world therefore these stupid questions.
My intention is to use the input field value and get a result in a small pop up window where the user can choose a specific record.
Any additional comments?
Thanky you for your help
Cheers Andreas
thanks for the answer.
What I miss now is the next step, connecting it to the data environment. I've used the properties window to add tables or sql statements to the commands but with a variable is this probably impossible. I am new to VB and the MS world therefore these stupid questions.
My intention is to use the input field value and get a result in a small pop up window where the user can choose a specific record.
Any additional comments?
Thanky you for your help
Cheers Andreas