PLS.... Help!!!
--------------------------------------------------------------------------------
hi commnunity
i have problem with sql,
i have created a table in Access Named TABLE1 in TABLE1 i have EmployeeNumber, Section, Posotion;
i assigned EmployeeNumber as text1.text
Section as text2.text
Posotion as text3.text
i have buttons name ADDrecord,
here is my code:
- Private Sub Command1_Click()
-
Dim EmployeeNumber As String
-
Dim Section As String
-
Dim Postion As String
-
-
Dim strSQL As String
-
Text1.Text = EmployeeNumber
-
Text2.Text = Section
-
Text3.Text = Position
-
-
strSQL = "INSERT INTO TABLE1 (EmployeeNumber, Section, Position) " & _
-
"VALUES('" & [EmployeeNumber] & "','" & [Section] & _
-
"'," & [Position] & ")"
-
Adodc1.RecordSource = strSQL
-
Adodc1.Recordset.Save
-
Adodc1.Refresh
-
-
-
-
End Sub
-
-
-
Private Sub Form_Load()
-
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Maan\My Documents\db4.mdb;Persist Security Info=False"
-
Adodc1.RecordSource = "SELECT * FROM Table1"
-
End Sub
is this Correct? pls.. make an example for me...
thank you in advance
Julius
--------------------------------------------------------------------------------