MushroomKing
Registered User.
- Local time
- Yesterday, 17:43
- Joined
- Jun 7, 2018
- Messages
- 100
Hi guys!
Im sure the answer is somewhere, but after a day of googling, I still need to ask. Please help
What I want to do:
I have a form, with filters on the headers, and I want to send the filtered results (records) to a table. Not overwrite, but add them.
So what I did is copying the data to the table, but Unfiltered!
This is my code so far:
The filters I used on the form headers, are the ones like this for example
:
Hope someone knows what to do Thanks in advance!!!
Im sure the answer is somewhere, but after a day of googling, I still need to ask. Please help
What I want to do:
I have a form, with filters on the headers, and I want to send the filtered results (records) to a table. Not overwrite, but add them.
So what I did is copying the data to the table, but Unfiltered!
This is my code so far:
Code:
Private Sub Command14_Click()
Dim rs As DAO.Recordset
Dim tblRS As DAO.Recordset
Dim strSql As String
Dim varRecCnt, cntr
strSql = Forms!calculation.RecordSource
Set rs = CurrentDb.OpenRecordset(strSql)
rs.MoveLast
rs.MoveFirst
varRecCnt = rs.RecordCount
Set tblRS = CurrentDb.OpenRecordset("chart")
For cntr = 1 To varRecCnt
tblRS.AddNew
tblRS("employee") = rs("employee")
tblRS("mistakes") = rs("mistakes")
tblRS("lines") = rs("lines")
tblRS("mistake_perc") = rs("mistake_perc")
tblRS("datestamp") = rs("datestamp")
tblRS.Update
rs.MoveNext
Next cntr
tblRS.Close
Set tblRS = Nothing
rs.Close
Set rs = Nothing
End Sub
The filters I used on the form headers, are the ones like this for example
Code:
DoCmd.GoToControl "employee"
DoCmd.RunCommand acCmdFilterMenu
Hope someone knows what to do Thanks in advance!!!