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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

catching and Inserting a value from a comb box

Status
Not open for further replies.

iedied

MIS
Joined
Dec 16, 2003
Messages
4
Location
US
I am a VB.net beginner. I want to put a check box under a comb. box. Once a user check the the check box, I will insert the row from the comb box into a table for my Pocket PC project. So far, I had problems catching and inserting the dynamic value into the table.

Pls advice.
 
Could you give a sample of your code and make changes if privilege information is used...
 
bduke,
Thank you for the response.
I have a combo box that displays all the machine names from a record set. Under the combo box is the list box that lists all the work performed related to each machine.
I now add a check box. Once user check the check box, I will need to insert the machine number into a new table.
The check box code is:

Dim x As String
If ChkBox.Checked Then
x = (db100_rec_array(CombEquip.SelectedIndex))

cnDataFile.Execute("INSERT INTO Inspect values x")
End If

When I trace the program, x has the value of "12345", but it didn't insert that value into the table.I hard coded it as
cnDataFile.Execute("INSERT INTO Inspect values '12345')"). It worked.

I noticed that declaring x as a string, the assigned value has double quto of "12345". I tried to declare x as a number and put cnDataFile.Execute("INSERT INTO Inspect values 'x')"), it inserted x into the table.

Am I on the right track? Or is there a better way to do this?

Thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top