Alright folks - he is back with his final task.
this is a simple one, yet i cannot seem to do it no matter how many google searches i do.
Debug.print is:
INSERT INTO search_results('Table', 'number_of_records') VALUES ('Employees', empCount)
i am simply trying to put the name of the table along with the count of records into the search results table. the records get counted properly but when i run the code it prompts me to enter a parameter value for empCount. this is simply a test example, once this works i will implement it for the rest of the necessary tables.
this is the last one i promise
this is a simple one, yet i cannot seem to do it no matter how many google searches i do.
Code:
Dim empCount As Integer
Dim sqlresults As String
'count tables
empCount = DCount("*", "Employees_search")
'display tables
If empCount > 0 Then
MsgBox "yes"
sqlresults = "INSERT INTO search_results("
sqlresults = sqlresults & "'Table'" & ","
sqlresults = sqlresults & " 'number_of_records'" & ") VALUES ("
sqlresults = sqlresults & "'Employees'" & ","
sqlresults = sqlresults & " empCount" & ")"
Debug.Print sqlresults
DoCmd.RunSQL sqlresults
End If
End Sub
Debug.print is:
INSERT INTO search_results('Table', 'number_of_records') VALUES ('Employees', empCount)
i am simply trying to put the name of the table along with the count of records into the search results table. the records get counted properly but when i run the code it prompts me to enter a parameter value for empCount. this is simply a test example, once this works i will implement it for the rest of the necessary tables.
this is the last one i promise