mtrimpin24 said:
1. it actually asks me for the excel spreadsheet twice. why do we ask for
the name of the excel spreadsheet after doing the import?
Your code has
strFile = GetExcel()
strFile = InputBox("Enter excel filename")
Remove the second line.
2. I get an error at line CurrentDb.Execute strSQL
it says it expects 4 arguments?
Is it saying 4 arguments, or 4 parameters? If 4 parameters, are you sure
that you spelled the names of all of the fields correctly? Also, is
sapcompanycode perhaps a text field, not a numeric one? If so, change
sapcompanycode in (010,528,185,113)
to
sapcompanycode in ('010','528','185','113')
3. on the front end of my database i'll need a piece of code that links
to
a checkbox. if the user clicks the checkbox to true, the record is
removed,
and replaced by the next valid record on the list, using the same rules we
used before to import the data in the first place. The point of this is
that
if the user discovers that somoene mispelled "Mileage" (someone inevitably
will) that they can reject the record on that basis, and get another one.
i
dont know how to do this front end to back end interaction.
Sorry, but this isn't clear to me.
For what it's worth, with linked tables, the fact that you've got a
front-end and back-end really is pretty much irrelevant: you work with the
linked tables the same as if they were in the same database in almost all
cases.
strSQL = "select [postedamount], [reportname], [sapcompanycode]" & _
" from tableAppend " & _
" where (not ( (postedAmount >= 3500) or " & _
" ( (sapcompanycode in (010,528,185,113)) and (postedamount >=
1500) ) ))" _
& (Reportname <> "mile" Or "mileage" Or "mlg")
This SQL is invalid.
& (Reportname <> "mile" Or "mileage" Or "mlg")
needs to be either
& (Reportname <> "mile" And Reportname <> "mileage" And Reportname <>
"mlg")
or
& (Reportname NOT IN ("mile", "mileage", "mlg"))
(Rember, too, to change the sapcompanycode line if you had to previously.)