-
I have a question. I have 5 tables in a database how do i access them without using 5 differant data controls like i have check boxes and if that is checked then i want it to open that table so i can write to that table? if anyone can help me that would be great
-
You mean change the RecourdSource?
Code:
Data1.RecordSource = "Employees"
Data1.Refresh
-
Code:
Dim sTableName As String
Select Case CheckBoxArray
Case CheckBoxArray(0)
sTableName = "First_Table"
Case CheckBoxArray(1)
sTableName = "Second_Table"
Case CheckBoxArray(2)
sTableName = "Third_Table"
'and so on
End Select
'Then use the table name in you SQL statement
'to insert records into that table
-
yes that is exactly what i want now whats the code i saw some but im not sure exactly with sql
-
You mean like this:
Code:
rst.RecordSource = "TableName"
rst.AddNew
rst.Fields("Field1").Value = "xxx"
rst.Fields("OtherField").Value = 5
rst.Update