Re: Help!!!
- From: "Bill" <stanton@xxxxxxx>
- Date: Thu, 30 Jun 2005 01:56:26 GMT
Hi Belinda!
Sorry for the delay, I was gone all day.
Here are a couple of code segments that use both the
Kill and Dir commands.
================================================
Private Sub ZipOnlyCmd_Click()
If Me.Check76 + Me.Check78 + Me.Check79 + Me.Check80 + Me.Check81 = 0 Then
msgbox "No files selected"
Else
Me.Refresh
If Dir(Me.DistZIPName) <> "" Then Kill Me.DistZIPName 'Delete the
file before we prepare contents of a new one.
Call SendADFData(False)
End If
End Sub
================================================
Note that in this example that Me.DistZIPName is a character string
containing the fully qualified name and path of the file of interest. The
code simply deletes it if it already exists.
Bill
"Belinda" <belindaNOblokSPAM@xxxxxxxxxxx> wrote in message
news:5ECDA710-FF1D-44F6-A76E-6CD4CBBF3EFB@xxxxxxxxxxxxxxxx
> Excellent...that's a different and less complicated approach.
>
> Any suggestions how do I do that? (have never used the Dir/kill commands)
>
> "Bill" wrote:
>
>> Hi Belinda,
>> Will it suffice to delete the downloaded file after you've
>> imported its contents into the Access table, then each
>> time your user seeks to run the report you can look for the
>> existance of the downloaded file? That is, you always demand
>> the existance of the downloaded file before you run the report.
>> If so, then use the Kill command to delete the file after you've
>> imported it and use the Dir command to detect its presence.
>>
>> This approach assumes it's not unacceptable to download
>> every time the report is run AND that there's no harm done to
>> the Access table if the import is re-run somewhat redundantly.
>>
>> Hope this helps.
>> Bill
>>
>>
>> "Belinda" <belindaNOblokSPAM@xxxxxxxxxxx> wrote in message
>> news:10AA442A-7AF3-4826-A073-4374E474E9EB@xxxxxxxxxxxxxxxx
>> >I need some desperate help.
>> >
>> > BACKGROUND
>> > I have some users that can't grasp the concept they need to download
>> > (from
>> > a
>> > mainframe) a report before the go clicking buttons in an Access
>> > database.
>> > This results in old data getting processed back into the report. An
>> > exception query shows the discrepancies but I have to personally go in
>> > and
>> > delete the older records whenever they do this. I have rigged Monarch
>> > (DataWatch's software to process mainframe report into table format)
>> > via a
>> > calculated field and a filter to export only those fields with the
>> > current
>> > date (so, wrong date, report exports a blank row).
>> >
>> > Request
>> > I know how to do the MsgBox in Access that will tell them "YOU IDIOT!!
>> > Download the report FIRST." What I need is Access to look at the
>> > report
>> > it
>> > imports (Monarch's resulting table) and if it's blank, row count=0,
>> > file
>> > size
>> > =1kb, whatever, that it will then pop up a message box. If report OK,
>> > then
>> > it will proceed as usual.
>> >
>> > Warnings
>> > I'm an Access idiot, please don't give me anything too complicated...
>> >
>> > CODE
>> > Private Sub cmdImportFiles_Click()
>> > Dim stAppName As String
>> > 'Launch Monarch and process today's report
>> > stAppName = "H:\IMPORT\IMPSAS\APEX\Macros\PCSOL.bat"
>> > Call ShellWait(stAppName, 1)
>> > DoCmd.Hourglass True
>> > DoCmd.SetWarnings False
>> > 'Import today's report into Access
>> > DoCmd.TransferDatabase acImport, "dBase 5.0",
>> > "H:\IMPORT\IMPSAS\APEX\MFiles\", acTable, "STARFAX.DBF", "starfax"
>> >
>> > <INSERT FILE CHECK HERE>
>> > -----------
>> >
>> > Thanks!!
>>
>>
>>
.
- References:
- Help!!!
- From: Belinda
- Re: Help!!!
- From: Bill
- Re: Help!!!
- From: Belinda
- Help!!!
- Prev by Date: Re: Intercept Access's "duplicate value" error message
- Next by Date: Re: Date Filter based off Text Box
- Previous by thread: Re: Help!!!
- Next by thread: One form two uses
- Index(es):