odd problem in access 2003

A

Arild Larsen

Hello
Due to some very odd differences in Access English and Norwegian editons, i
have to make the following check whwn exporting a report.
Code to print and send report see boldface comments :
************
Private Sub cmdSkrivUt_Click()
On Error GoTo Err_cmdSkrivut_Click

Me.Visible = False
'Dim Melding, Stil, Tittel, Svar
Dim BestillingNr As String
BestillingNr = Me.BestillingID



Dim Dag As String
Dim strReport As String
Dim MinFilbane As String

Dag = Format(Me.BestillingDato, "Short date")
strReport = "rptLevBest"

'Store snapshot path in a table rather than hard-coded
MinFilbane = DLookup("SNPPath", "tblSettings", "SNPPathID = 2")

DoCmd.OpenReport strReport, acPreview

If MsgBox("Vil du lagre Rapporten for sending nå?", vbYesNo + vbQuestion,
"Lagre?") = vbYes Then
If Not FDirExists(MinFilbane) Then
If MsgBox("Banen som er oppgitt for denne filen eksisterer
ikke, vil du lage den?", vbYesNo + vbQuestion, "Lagre?") = vbYes Then
If Not FCreateDir(MinFilbane) Then
'
' Failed making new directory. Error message already
given
GoTo Exit_cmdSkrivut_Click
Else
MsgBox "Bane/mapper er nå opprettet", vbInformation,
"Filbane opprettet"
End If
End If
End If
Dim mli As MsoLanguageID

mli = Application.LanguageSettings.LanguageID(msoLanguageIDHelp)
If mli = 1033 And Application.Version = "11.0" Then 'engelsk
DoCmd.OutputTo acReport, strReport, acFormatSNP,
MinFilbane & "Bestilling-" & BestillingNr & "-" & Dag & ".snp" 'This does'nt
work in the norwegian version
Else
'norsk
DoCmd.OutputTo acReport, strReport,
"Øyeblikksbildeformat(*.snp)", MinFilbane & "Bestilling-" & BestillingNr &
"-" & Dag & ".snp" 'This do
End If
MsgBox "Bestillingen er nå lagret i " & MinFilbane &
"Bestilling-" & BestillingNr & "-" & Dag & ".snp", vbInformation, "Rapport
Lagret"
OutlookBane = CStr(MinFilbane & "Bestilling-" &
BestillingNr & "-" & Dag & ".snp")
If MsgBox("Vil du sende denne i en ny mail nå?", vbQuestion
+ vbYesNo, "Sende Nå") = vbYes Then
Call sbSendMessage(OutlookBane)
End If
Else
' MsgBox "OK, bare vær sånn du!", vbInformation, "All den kodinga til
ingen nytte..."
End If




Exit_cmdSkrivut_Click:
Exit Sub

Err_cmdSkrivut_Click:
If err.Number = 13 Then
GoTo neste
Else
Call ErrorLog(Me.Name, "cmdSkrivut_Click")
If StandardErrors(err) = False Then
MsgBox err & ": " & err.Description
End If
neste:
Resume Exit_cmdSkrivut_Click
End If
End Sub
this caused me a lot of headache :) I'm close to call tihs a bug.Do anyone
have a comment or other solution?

MVH

Arild Larsen
 

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