habinalshaikh
New member
- Local time
- Today, 18:43
- Joined
- Jul 6, 2024
- Messages
- 7
Hello dears ..
I'm writing a program to add training data to a table named "Dashboard"
some of the training data I import from excel spreadsheet and the other some data I take from the access combo boxes
the table that I named with "Dashboard" contains of :
ID (The primary key)
Project (a combo box feild)
Section (a combo box feild)
Vender (a combo box feild)
Course (a combo box feild)
Employee_ID (I take the data from Excel spreadsheet)
Attendance_Status ( this feild will be based on calculation with another feild)
Attendance_Hourse (I take the data from Excel spreadsheet)
Pre-Assessment (I take the data from Excel spreadsheet)
Post-Assessment (I take the data from Excel spreadsheet)
Cost (I take the data from Excel spreadsheet)
My question is : How can I fill the table with some data I take from an excel spreadsheat and some data I take from combo boxes in the access table same record
I tried fill up the table with Project and the data from the excel spreadsheet by writing the following code :
Private Sub Command12_Click()
Dim strExcelPath As String
strExcelPath = txtPath.Value
Dim numberofparticipant As Integer
Dim SQLstr As String
SQLstr = "INSERT INTO Dashboard (Project) VALUES (" & Project.ListCount & ");"
For numberofparticipant = 1 To 7
DoCmd.SetWarnings False
DoCmd.RunSQL SQLstr
DoCmd.SetWarnings True
Dim FSO As New FileSystemObject
If FSO.FileExists(txtPath.Value) Then
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Dashboard", strExcelPath, True
End If
Next numberofparticipant
End Sub
But It filled the data (which is from the excel spreadsheet) after that It filled the project (which is from the combo box) in another records
I'm writing a program to add training data to a table named "Dashboard"
some of the training data I import from excel spreadsheet and the other some data I take from the access combo boxes
the table that I named with "Dashboard" contains of :
ID (The primary key)
Project (a combo box feild)
Section (a combo box feild)
Vender (a combo box feild)
Course (a combo box feild)
Employee_ID (I take the data from Excel spreadsheet)
Attendance_Status ( this feild will be based on calculation with another feild)
Attendance_Hourse (I take the data from Excel spreadsheet)
Pre-Assessment (I take the data from Excel spreadsheet)
Post-Assessment (I take the data from Excel spreadsheet)
Cost (I take the data from Excel spreadsheet)
My question is : How can I fill the table with some data I take from an excel spreadsheat and some data I take from combo boxes in the access table same record
I tried fill up the table with Project and the data from the excel spreadsheet by writing the following code :
Private Sub Command12_Click()
Dim strExcelPath As String
strExcelPath = txtPath.Value
Dim numberofparticipant As Integer
Dim SQLstr As String
SQLstr = "INSERT INTO Dashboard (Project) VALUES (" & Project.ListCount & ");"
For numberofparticipant = 1 To 7
DoCmd.SetWarnings False
DoCmd.RunSQL SQLstr
DoCmd.SetWarnings True
Dim FSO As New FileSystemObject
If FSO.FileExists(txtPath.Value) Then
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "Dashboard", strExcelPath, True
End If
Next numberofparticipant
End Sub
But It filled the data (which is from the excel spreadsheet) after that It filled the project (which is from the combo box) in another records