vb6 code calling access97 runtime switch invokes two versions acc

D

dk

The vb6 code below show a login for access97 when called from vb.
One login appears, and if it is clicked right away, the runtime of access works
fine, but if the login is not clicked right away, a second login appears. Then if
either login is clicked an empty runtime version of access appears and
a regular version appears with the report and mdb file. Is there a way to only
insure that the runtime opens?

tia,
dk


Dim AccessApp As Object
Dim mode As Byte
Dim nNumber As Integer
Dim strDescription As String
Dim x As Long


x = Shell("c:\program files\microsoft office\office\msaccess.exe w:\Common\munigic\NewModel\ICMS\ICMSReportsFax.mdb /Runtime")


Sleep 5000


Set AccessApp = GetObject("w:\common\munigic\newmodel\icms\icmsreportsfax.mdb")


If bPreview Then
mode = 2
Else
mode = 0
End If

On Error GoTo finish
With AccessApp

If strReportName = "CustomerStatementAllCopiesStorQM" Then
Dim out_fn, storqm_loc As String
Const acOutputReport = 3
Const acFormatTXT = "MS-DOS Text (*.txt)"

storqm_loc = "\\wlbny-banking\gics\storqm\mungic"
out_fn = storqm_loc & Format(ReportParameters.txtAsOfDate.Text, "YYYYMMDD") & ".TXT"
.DoCmd.OutputTo acOutputReport, "Customer Statement All Copies StorQM", acFormatTXT, out_fn
Else
.DoCmd.OpenReport strReportName, mode, , strFilter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top