Hi,
Im trying to make some VBA Sql queries, this below one works ok.
Function Delete_Table_Mysql_XYZ()
Dim DelMysql As String
DelMysql = "DELETE mysql_dealer_10076.*, * from mysql_dealer_10076;"
DoCmd.SetWarnings warningsoff
DoCmd.RunSQL DelMysql
DoCmd.SetWarnings warningson
End Function
This is my updated version, i want to pass the variable over to the query so i dont have to write multiple functions.
Function Delete_Table_Mysql(Optional Custno)
Dim DelMysql As String
DelMysql = "DELETE mysql_dealer_" & Custno & ".*, * from mysql_dealer_" & Custno & ";"
DoCmd.SetWarnings warningsoff
DoCmd.RunSQL DelMysql
DoCmd.SetWarnings warningson
End Function
Is this an obvious mistake im making?? Can anyone point me to where Ive gone wrong?
Im trying to make some VBA Sql queries, this below one works ok.
Function Delete_Table_Mysql_XYZ()
Dim DelMysql As String
DelMysql = "DELETE mysql_dealer_10076.*, * from mysql_dealer_10076;"
DoCmd.SetWarnings warningsoff
DoCmd.RunSQL DelMysql
DoCmd.SetWarnings warningson
End Function
This is my updated version, i want to pass the variable over to the query so i dont have to write multiple functions.
Function Delete_Table_Mysql(Optional Custno)
Dim DelMysql As String
DelMysql = "DELETE mysql_dealer_" & Custno & ".*, * from mysql_dealer_" & Custno & ";"
DoCmd.SetWarnings warningsoff
DoCmd.RunSQL DelMysql
DoCmd.SetWarnings warningson
End Function
Is this an obvious mistake im making?? Can anyone point me to where Ive gone wrong?