enfrspit
02-23-2011, 12:01 AM
Hi everyone, i'm very amateur in VB for Access. I'm just one add a column into a table automatically. I've a table named "Nghich". Now i want to add a text filed into this table. I name the field "Hehe". What i write is:
Private Sub Toggle8_Click()
Dim SQL2 As String
SQL2 = "ALTER TABLE Nghich ADD COLUMN Hehe TEXT(255)"
DoCmd.RunSQL SQL2
MsbBox ("Done")
End Sub
I do realize it's simple, but i've not succeeded to compile the right syntax. It always says:" Compile error: Sub or Function not defined"
Please, help me.
Thank all of you for your help.
Private Sub Toggle8_Click()
Dim SQL2 As String
SQL2 = "ALTER TABLE Nghich ADD COLUMN Hehe TEXT(255)"
DoCmd.RunSQL SQL2
MsbBox ("Done")
End Sub
I do realize it's simple, but i've not succeeded to compile the right syntax. It always says:" Compile error: Sub or Function not defined"
Please, help me.
Thank all of you for your help.