Hi guys i'm writing a vb program which got using the sql statement

i know the sql statement is using method insert

but my one is much different. The code concept is like this

If cmbActive= true then

sql=insert into staff_badgeTrackingNew = txtEmpID, txtEmpName, TxtID

Else
sql= insert into staff badgeTracking= txtEmpID, txtEmpName, txtID


If the proper code is how to write it can give me an example

once again...

SQL = "INSERT INTO TableName(Field1Name, Field2Name, ...) VALUES(" & val(text1.text) & ",'" & text2.text & "')"

Where TableName is the name of your table
Where Field*Name is the name of the field you are going to add data to
Where val(text1.text) is adding a numeric value to Field1Name
Where '" & text2.text & "')" denotes adding text to Field2Name


Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.