chainedtodesk
Programmer
can you use a variable within the sql query? i have a main db that receives tables from several laptops, i name the files accordingly to the laptop. i want the operator to select a file from a list i provide to update the main table, the table name carries over to portions of the code but does not seem to update the sql.
here is the shortened version of the code
Private Sub Command12_Click()
'DoCmd.SetWarnings False
Dim sql0 As String
Dim F As String
F = Forms!mainform.SelectedTable.Value
sql0 = "INSERT tblAuditsMain_ALL " & _
"SELECT F.* " & _
"FROM F "
DoCmd.RunSQL sql0
End Sub
form is just a list of tables they can select, after update i execute the above code
here is the shortened version of the code
Private Sub Command12_Click()
'DoCmd.SetWarnings False
Dim sql0 As String
Dim F As String
F = Forms!mainform.SelectedTable.Value
sql0 = "INSERT tblAuditsMain_ALL " & _
"SELECT F.* " & _
"FROM F "
DoCmd.RunSQL sql0
End Sub
form is just a list of tables they can select, after update i execute the above code