RE: Importing Excel Spreadsheet based on date in Form

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



This is my code.... I am getting an error of "Else without If"
Private Sub datemo_AfterUpdate()
If [datemo] = #3/1/2008# Then DoCmd.TransferSpread*** ,
acSpreadsheetTypeExcel9, "miscbilling", _
"V:\Diane for Access\03 March 2008 Vendor Billingtest.xls", True,
"miscbilling"

ElseIf [datemo] = #4/1/2008# Then DoCmd.TransferSpread*** ,
acSpreadsheetTypeExcel9, "miscbilling", _
"V:\Diane for Access\04 April 2008 Vendor Billingtest.xls", True,
"miscbilling"

ElseIf [datemo] = #5/1/2008# Then DoCmd.TransferSpread*** ,
acSpreadsheetTypeExcel9, "miscbilling", _
"V:\Diane for Access\05 May 2008 Vendor Billingtest.xls", True, "miscbilling"


"Klatuu" wrote:

Post the code you are using including the code that fails.
Include the error number and point out the line where it fails.
--
Dave Hargis, Microsoft Access MVP


"Diane" wrote:

I am trying to import a particular Excel Spread*** based on a date setup on
a form. I am trying to use an if-then-else statement and it continues to
bomb. If I just use on statement it works but if I try to add an Else
statment it doesn't. Any suggestions.
.


Quantcast