https://www.accessforums.net/showthr...n-Access-(2003)
This question is kind of based off the link above.
Background: I have an Excel sheet that I update each day which has a few entries a day about problems that occurred in operations and how many products were affected for each problem. I have no problem importing this tab into Access. I also ran a query to only show today's date, today's description of problems, and how many products were affected. What I'd like to do is have all of today's problems and these other fields to show up in an Access form once the data is imported.
Issue: I created a form to house fields "Date", "Description", "# Products Affected." I set the record source as the query that finds the problems that occured today. When I "run" the form, this information shows up fine, but only the first entry for that day. If there are 5 entries, only the first 1 would show up. But then, on the import/update button I made, I just get "#Deleted" in each of the fields.
Here's my code on the import button:
Code:
Private Sub Command11_Click()
Dim stDocName As String
Dim stLinkCriteria As String
DoCmd.SetWarnings False
CurrentDb.Execute "DELETE * from [File Name]"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "File name", "Location", True, "Cell Range"
MsgBox ("Log - Updated")
DoCmd.SetWarnings True
stDocName = "Query1_TodaysErrors"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Command129_Click:
Exit Sub
Err_Command129_Click:
MsgBox Err.Description
Resume Exit_Command129_Click
End Sub
Not sure if I posted too much, but didn't want to leave anything out! The program knows the query exists, hence why it posts the table after the message box, but am having trouble getting the fields in the query into the appropriate form fields once I hit the update button.
Appreciate any help. Let me know if you need more information. Thanks!