Hello everyone,
Not getting text data types.
I have use this code :
Can anyone solve this problemCode:Private Sub Command6_Click() Dim ssql As String ssql = "insert into table1(name,rollno,reason) values('" & Text0.Value & "'," & Text2.Value & ",'" & Text4.Value & "')" DoCmd.RunSQL ssql End Sub
try this:
Also, I prefaced the field references with "Me", assuming the button is on the same form where the fields are.Code:ssql = "INSERT INTO Table1 ( name, rollno, reason )" & _ " SELECT '" & Me.text0.value & "' AS Expr1, '" & Me.text2.value & "' AS Expr2, '" & Me.text4.value & "' AS Expr3;"
Hi,
Thanks for your reply this code works perfectly.
Thanks once again.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks