ahmedjamalaboelez
Ahmed J. Aboelez
- Local time
- Today, 16:39
- Joined
- Feb 25, 2015
- Messages
- 79
Good day Brothers,
I tried to replace tables names with a variable , so i can insert specific table , is that right to include table name as variable in method !!
Before i include Table1 and Table2 As Variables it was working fine ,
any solution ? Code Below
Code Is Here :
I Appreciate your Help;
Thanks
A.J
I tried to replace tables names with a variable , so i can insert specific table , is that right to include table name as variable in method !!
Before i include Table1 and Table2 As Variables it was working fine ,
any solution ? Code Below
Code Is Here :
Code:
Public Sub PendSpecTable(TableName1 As String, Tablename2 As String, IndexID As String)
Dim sql1 As String
Dim sql2 As String
sql1 = "INSERT INTO '" & TableName1 & "' SELECT lc_databases.* FROM lc_databases," & _
"WHERE (((lc_databases.database_id)='" & IndexID & "')),"""
sql2 = "INSERT INTO '" & Tablename2 & "' SELECT lc_dbconnections.* FROM lc_dbconnections," & _
"WHERE (((lc_dbconnections.cnn_databaseid)='" & IndexID & "')),"""
DoCmd.RunSQL sql1
DoCmd.RunSQL sql2
End Sub
' Define Listview Right To left------------------------------------
Public Sub list_search_Click()
[frm_idx] = list_search.SelectedItem.text
[sub_databases_view].SetFocus
FunDeleteLocal
'FunPendLocal
PendSpecTable "lc_databases_view", "lc_dbconnections_view", list_search.SelectedItem.text
FunSelectMode
[sub_databases_view].Requery
[sub_dbconnections_view].Requery
End Sub
I Appreciate your Help;
Thanks
A.J