Hi,
I have a from [ATC] with a textbox [project_id] where the user will input a field name. On the form I have a button to launch an event procedure to add (alter table )a new field to a specific tsable [TCodes]. so far I try almost everything my last script look like this:
Private Sub Command4_Click()
Dim strSql As String
Dim db As DAO.Database
Set Project = [Forms]![atc]![project_id].Form.Value
Set db = CurrentDb()
strSql = "ALTER TABLE TCodes ADD COLUMN project;"
db.Execute strSql, dbFailOnError
Set db = Nothing
End Sub
but I still get an error. Is there a way to pass the user input to the alter table?
I have a from [ATC] with a textbox [project_id] where the user will input a field name. On the form I have a button to launch an event procedure to add (alter table )a new field to a specific tsable [TCodes]. so far I try almost everything my last script look like this:
Private Sub Command4_Click()
Dim strSql As String
Dim db As DAO.Database
Set Project = [Forms]![atc]![project_id].Form.Value
Set db = CurrentDb()
strSql = "ALTER TABLE TCodes ADD COLUMN project;"
db.Execute strSql, dbFailOnError
Set db = Nothing
End Sub
but I still get an error. Is there a way to pass the user input to the alter table?