I have the following code for my Function that I want to assign to a button on my form.
' ImportDay2SurveyResults
'
'------------------------------------------------------------
Public Function ImportDay2SurveyResults()
On Error GoTo ImportDay2SurveyResults_Err
DoCmd.TransferSpreadsheet acImport, 10, "APP Orientation - Day 2", "U:\UWHealth\Nrsg-PCS\SpecialShares\APP Director\Education and Professional Development\Orientation\3. Orientation Program Day 2\Evaluations\APP Orientation Day 2 Survey Data Entry Macro.xlsm", True, "Survey Responses!A2:T50"
'I added the following code to run a delete query b/c the above command keeps adding 3-4 blank rows to my table. It's probably not the right code, but I couldn't figure out how to run the query versus open it.
DoCmd.SetWarnings False
DoCmd.OpenQuery "Qry DeleteBlankRows-Day2", acViewNormal, acReadOnly
ImportDay2SurveyResults_Exit:
Exit Function
ImportDay2SurveyResults_Err:
MsgBox Error$
Resume ImportDay2SurveyResults_Exit
End Function
I thought the following code would work, but it doesn't.
'Button Properties: Event>On Click>[Event Procedure]
Private Sub Command214_Click()
mdl_ImportDay2SurveyResults.ImportDay2SurveyResult s
End Sub
How do I get the event procedure to run the VBA code in my module?