Newsgroup: it.comp.appl.access
Titolo: Conversione dei moduli da A97 a A2003

Ciao a tutti,
premesso che sono un principiante, ho creato un programmino in access97,
ho provato a convertirlo in access2003
il db funziona bene, ritengo per� che i moduli compilati non siano stati
convertiti.
Faccio un esempio:
modulo che uso per impostare temporaneamente una stampante diversa da quella
predefinita:
PDFFILEINI (modulo):
Option Compare Database
Option Explicit
'Read INI settings
Declare Function GetPrivateProfileString Lib "kernel32" Alias _
   "GetPrivateProfileStringA" (ByVal lpApplicationName As String, _
   ByVal lpKeyName As Any, ByVal lpDefault As String, _
   ByVal lpReturnedString As String, ByVal nSize As Long, _
   ByVal lpFileName As String) As Long
'Write settings
Declare Function WritePrivateProfileString Lib "kernel32" Alias _
   "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
   ByVal lpKeyName As Any, ByVal lpString As Any, _
   ByVal lpFileName As String) As Long
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Function ReadINIfile(sSection As String, sEntry As String, sFilename As
String) As String
Dim x As Long
Dim sDefault As String
Dim sRetBuf As String, iLenBuf As Integer
Dim sValue As String
'Six arguments
'Explanation of arguments:
'sSection: ini file section (always between brackets)
'sEntry : word on left side of "=" sign
'sDefault$: value returned if function is unsuccessful
'sRetBuf$ : the value you're looking for will be copied to this buffer
string
'iLenBuf% : Length in characters of the buffer string
'sFileName: Path to the ini file
sDefault$ = ""
sRetBuf$ = String$(256, 0)   '256 null characters
iLenBuf% = Len(sRetBuf$)
x = GetPrivateProfileString(sSection, sEntry, _
           sDefault$, sRetBuf$, iLenBuf%, sFilename)
ReadINIfile = Left$(sRetBuf$, x)
End Function
PDFMODULOCREA (modulo)
Option Compare Database
Public Function creapdf(percorsopdf As String, NomeFile As String,
nomereport As String, Optional email As String)
'On Error GoTo Esci
'recupero la stampante predefinita
Dim tmpPrinter As String
tmpPrinter = GetDefaultPrinter1
'imposto come stampante predefinita la stampante pdfcreator
Dim stamp As String
stamp = DLookup("[stampante pdf]", "SetupParametri", "[ID] = 1")
SetDefaultPrinter1 (stamp)
    'Dim ValRit As Long
   ' Dim NomeFile As String
    Dim percorsoINI As String
    'Dim percorsopdf As String
'questo percorso � da impostare manualmente in base a dove si ha installato
il file pdfcreator.ini
    percorsoINI = DLookup("[percorso ini]", "SetupParametri", "[ID] = 1")
''''settare il percorso dove si trova il file pdfcreator
    'PercorsoPDF = "c:\" ''''' settare il percorso dove si vuole salvare il
file
    'NomeFile = "provailfilepdf" ''''settare il nome del file che si vuole
assegnare
    Dim tmppercorsopdf As String
    Dim tmpuseautosave As String
    Dim tmpnomefile As String
    Dim tmpformatooutput As String
Dim formatooutput As String
formatooutput = DLookup("[formato output]", "SetupParametri", "[ID] = 1")
''''settare il percorso dove si trova il file pdfcreator
MsgBox formatooutput
    'recupero le SetupParametri del file ini originarie
    tmppercorsopdf = ReadINIfile("Options", "AutosaveDirectory",
percorsoINI) 'legge dal file
    tmpuseautosave = ReadINIfile("Options", "useAutosave", percorsoINI)
'legge dal file
    tmpnomefile = ReadINIfile("Options", "AutosaveFilename", percorsoINI)
'legge dal file
    tmpformatooutput = ReadINIfile("Options", "AutosaveFormat", percorsoINI)
'legge dal file
    'setto le SetupParametri del file ini come servono per creare il
documento
    x = WritePrivateProfileString("Options", "AutosaveDirectory",
percorsopdf, percorsoINI) 'scrive nel file
    x = WritePrivateProfileString("Options", "AutosaveFilename", NomeFile,
percorsoINI) 'scrive nel file
    x = WritePrivateProfileString("Options", "useautosave", "1",
percorsoINI) 'scrive nel file
    x = WritePrivateProfileString("Options", "AutosaveFormat",
formatooutput, percorsoINI) 'scrive nel file
   'stampo il report
    DoCmd.OpenReport nomereport, acViewNormal ''''settareilnomedelreport
    'ReSetDefaultPrinter1
    Sleep (2000)
    'Ripristino i valori predefiniti
    x = WritePrivateProfileString("Options", "AutosaveDirectory",
tmppercorsopdf, percorsoINI) 'scrive nel file
    x = WritePrivateProfileString("Options", "AutosaveFilename",
tmpnomefile, percorsoINI) 'scrive nel file
    x = WritePrivateProfileString("Options", "useautosave", tmpuseautosave,
percorsoINI) 'scrive nel file
    x = WritePrivateProfileString("Options", "useautosave",
tmpformatooutput, percorsoINI) 'scrive nel file
'ripristino la stampante predefinita
SetDefaultPrinter1 (tmpPrinter)
    Exit Function
'Esci:
'MsgBox Error
End Function
PDFPRINTERS (modulo)
Option Compare Database
Option Explicit
'funzione di Carlo Costarella, Lorenzo Coronati
Declare Function GetProfileSection& Lib "kernel32" Alias
"GetProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As
String, ByVal nSize As Long)
Declare Function GetProfileString& Lib "kernel32" Alias "GetProfileStringA"
(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As
String, ByVal lpReturnedString As String, ByVal nSize As Long)
Declare Function WriteProfileString& Lib "kernel32" Alias
"WriteProfileStringA" (ByVal lpszSection As String, ByVal lpszKeyName As
String, ByVal lpszString As String)
Public DefaultPrinter1 As String
Public Function SostCar(s As String, c1 As String, c2 As String) As String
'sostituisce un carattere con un altro in una stringa (solo prima
occorrenza)
Dim pos As Integer
pos = InStr(1, s, c1)
If pos > 0 Then Mid(s, pos) = c2
SostCar = s
End Function
Public Sub SetDefaultPrinter1(s As String)
'imposta la stampante passata come argomento a predefinita
On Error GoTo Esci
Dim x As Long
If IsNull(s) Or s = "" Then Exit Sub
x = WriteProfileString("windows", "device", vbNullString)
DoEvents
x = WriteProfileString("windows", "device", s)
DoEvents
Esci:
End Sub
Public Sub ResetDefaultPrinter1()
'reimposta a predefinita la stampante memorizzata nella var globale
SetDefaultPrinter1 (DefaultPrinter1)
End Sub
Public Function GetDefaultPrinter1() As String
'ritorna il nome della stampante predefinita
Dim x As Integer
Dim buffer As String
buffer = Space$(255)
x = GetProfileString("windows", "device", "?", buffer, 255)
GetDefaultPrinter1 = Left$(buffer, x)
End Function
nella routine della maschera la richiamo:
            Call creapdf("c:\", "pipponew", "BOLLA")
non funziona stampa con la stampante predefinita.
altro modulo che non funziona:
Option Explicit
'Descrizione PROPRIETA' della CLASSE
'
'Propriet� da IMPOSTARE (LET)
'
'     .Continuos_Bar             =Modo grafico di Visualizzazione
'                                 True    =Continuo
'                                 False   =Tratteggiato (DEFAULT)
'     .Min                       =Valore MINIMO da cui parte
'                                 DEFAULT=0
'     .Max                       =Valore MASSIMO a cui arriva
'                                 DEFAULT=100
'     .Colora                    =Colore della Barra di PROGRESSIONE
'     .BackColor                 =Colore di SFONDO della Barra di
PROGRESSIONE
'     .ManualPosition            =Imposta/Ripristina AutoProgress o
ManualProgress
'                                 Default = False
'                                 Con il Passagio delle COORDINATE viene
'                                 settato=TRUE, per tornare in AUTOPROGRESS
'                                 va ripristinato
'     .Speed_AutoPB              =Setta la VELOCITA' della Barra di
PROGRESSIONE
'                                 SOLO IN AUTOPROGRESS
'
'Propriet� RESTITUITE (GET)
'     .Hwnd_ProgressBar          =Restituisce il VALORE(Long) dell'HWND
della BARRA
'     .ValuePercentage           =Valore Percentuale
'     .ValueAbsolute             =Valore Assoluto Relativo
'
'Metodi della Classe
'
'     .AutomaticProgress         =Genera un Ciclo di Scansione(SIMULAZIONE)
'                                 Pu� essere con Posizione Manuale o
Automatica
'                                 PosizionePredefinita=DEFAULT=Fondo Form
'     .Value                     =Aggiorna il VALORE Relativo della Barra di
PROGRESSIONE
'                                  N.B.� dipendente da .Max e .Min
'                                  VALORE da passare (LONG)
'     .Resize                    =Ricalcola le dimensioni della Form nel
caso
'                                 del Posizionamento Automatico su Fondo
Form
'                                 Da applicare all'EVENTO ON_RESIZE di FORM
'     .ProgressInStatus          =Attribuisce la PROGRESS alla STATUS_BAR
'                                 VALORI DA PASSARE:
'                                 Hwnd(Long) della STATUS_BAR
'                                 Numero di Sezione(Byte) della STATUS
'     .SetManualPosition         =Imposta la posizione della Barra di
PROGRESSIONE
'                                 VALORI DA PASSARE in TWIPS(Standard di
ACCESS):
'                                 LEFT(Long) TOP(Long) Height(Long)
Width(Long)
'=========================================================================
'Variabile per il calcolo del rapporto Twips/Pixel
Private Type POINTAPI
    x As Long
    Y As Long
End Type
'Variabile per la POSIZIONE dell'Oggetto
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
'Variabile per le misure dimensionali dell'Oggetto
Private Type Coords
    Left As Long
    Top As Long
    Width As Long
    Height As Long
    State As Long
End Type
Private Const cTwipsPerInch = 1440          'Costante 1 Inch = 1440 Twips
Private mptCurrentScreen As POINTAPI        '
Private mptTwipsPerPixel As POINTAPI        '
Private Const SM_CXFULLSCREEN = 16
Private Const SM_CYFULLSCREEN = 17
Private Const LOGPIXELSX = 88               '  Logical pixels/inch in X
Private Const LOGPIXELSY = 90               '  Logical pixels/inch in Y
Private mFCOORDS As Coords
'Costanti di dimensione BORDI Finestre
Private Const cBorderWidthX = 2
Private Const cBorderWidthY = 2
'--------------------------------------------------------------------------
'API per la gestione del calcolo DIMENSIONALE
Private Declare Function GetDC _
 Lib "user32" _
 (ByVal hwnd As Long) As Long
Private Declare Function GetSystemMetrics _
 Lib "user32" _
 (ByVal nIndex As Long) As Long
Private Declare Function GetDeviceCaps _
 Lib "gdi32" _
 (ByVal hdc As Long, ByVal nIndex As Long) As Long
Private Declare Function GetParent _
 Lib "user32" _
 (ByVal hwnd As Long) As Long
Private Declare Function GetWindowRect _
   Lib "User32.dll" _
   (ByVal hwnd As Long, lpRect As RECT) As Long
'===========================================================================
=========
'COSTANTI PERSONALIZZATE
Private m_hProgBar As Long                  'HWnd della PROGRESS
Private m_ParentHwnd As Long                'HWnd eventuale della Status
Private m_Continuos As Boolean              'Modalit� di visualizzazione
                                            'True   =   CONTINUA
                                            'False  =   TRATTI
Private m_ManualSetting As Boolean          'Abilita il posizionamento
Manuale
Private m_Speed As Integer                  'Velocit� di scorrimento
Private m_PB_Color As Long                  'Colore della PROGRESS
Private m_PB_BackColor As Long              'Sfondo della PROGRESS
Private mF As Form                          'Form di destinazione
Private m_Min As Long                       'Valore MINIMO
Private m_Max As Long                       'Valore MASSIMO
Private m_Percentage As Integer             'Valore Percentuale
Private m_Absolute   As Long                'Valore Assoluto relativo
Private m_IsCreate As Boolean               'Flag di PB esistente in Manuale
Private m_Width As Long                     'LARGHEZZA
Private m_Height As Long                    'ALTEZZA
Private m_Left As Long                      'SINISTRA
Private m_Top As Long                       'ALTO
Private Const PBGrey = 12632256             'Costante colore=Grigio
Private Const PBBlu = 8388608               'Costante colore=Blu
Private Const PBSpeed = 1                   'Costante Velocit�
'===========================================================================
=========
'Costanti di PROGRESS BAR CONTROL
Private Const PROGRESS_CLASS = "msctls_progress32"
Private Const WM_USER = &H400
Private Const PBM_SETRANGE = (WM_USER + 1)
Private Const PBM_SETPOS = (WM_USER + 2)
Private Const PBM_DELTAPOS = (WM_USER + 3)
Private Const PBM_SETSTEP = (WM_USER + 4)
Private Const PBM_STEPIT = (WM_USER + 5)
Private Const PBM_SETRANGE32 = (WM_USER + 6)
Private Const PBM_GETRANGE = (WM_USER + 7)
Private Const PBM_GETPOS = (WM_USER + 8)
Private Const PBM_IterNum = 100
Private Const PBM_Max = 100
Private Const PBM_Min = 0
'set progressbar backcolor in IE3 or later
Private Const PBM_SETBKCOLOR  As Long = (&H2000& + 1)
'set progressbar barcolor in IE4 or later
Private Const PBM_SETBARCOLOR As Long = (WM_USER + 9)
'Costanti di STATUS BAR CONTROL
Private Const SB_GETPARTS As Long = WM_USER + 6
Private Const SB_GETRECT = (WM_USER + 10)
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA"
_
                          (ByVal dwExStyle As Long, ByVal lpClassName As
String, _
                           ByVal lpWindowName As String, ByVal dwStyle As
Long, _
                           ByVal x As Long, ByVal Y As Long, _
                           ByVal nWidth As Long, ByVal nHeight As Long, _
                           ByVal hWndParent As Long, ByVal hMenu As Long, _
                           ByVal hInstance As Long, lpParam As Any) As Long
' Styles
Private Const PBS_SMOOTH = &H1
Private Const WS_VISIBLE = &H10000000
Private Const WS_CHILD = &H40000000
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As
Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
                          (ByVal hwnd As Long, ByVal wMsg As Long, _
                          wParam As Any, lParam As Any) As Long
'===========================================================================
=============
Private Declare Function IsWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function MoveWindow Lib "user32" _
                              (ByVal hwnd As Long, _
                              ByVal x As Long, ByVal Y As Long, _
                              ByVal nWidth As Long, ByVal nHeight As Long, _
                              ByVal bRepaint As Long) As Long
'===========================================================================
=============
'API per verificare la presenza della DLL ComCtl32.Dll
' Ensures that the common control dynamic-link library (DLL) is loaded.
Private Declare Sub InitCommonControls Lib "ComCtl32.dll" ()
' IE3 & later
' Returns TRUE (non-zero) if successful, or FALSE otherwise.
Private Declare Function InitCommonControlsEx Lib "ComCtl32.dll" _
                            (lpInitCtrls As tagINITCOMMONCONTROLSEX) As
Boolean
Private Type tagINITCOMMONCONTROLSEX   ' icc
    dwSize As Long                              ' // size of this structure
    dwICC As Long                               ' // flags indicating which
classes to be initialized
End Type
' Set of bit flags that indicate which common control classes will be
' loaded from the DLL. This value can be a combination of the following:
Private Const ICC_LISTVIEW_CLASSES = &H1        ' // listview, header
Private Const ICC_TREEVIEW_CLASSES = &H2        ' // treeview, tooltips
Private Const ICC_BAR_CLASSES = &H4             ' // toolbar, statusbar,
trackbar, tooltips
Private Const ICC_TAB_CLASSES = &H8             ' // tab, tooltips
Private Const ICC_UPDOWN_CLASS = &H10           ' // updown
Private Const ICC_PROGRESS_CLASS = &H20         ' // progress
Private Const ICC_HOTKEY_CLASS = &H40           ' // hotkey
Private Const ICC_ANIMATE_CLASS = &H80          ' // animate
Private Const ICC_WIN95_CLASSES = &HFF          ' // loads everything above
Private Const ICC_DATE_CLASSES = &H100          ' // month picker, date
picker, time picker, updown
Private Const ICC_USEREX_CLASSES = &H200        ' // comboex
Private Const ICC_COOL_CLASSES = &H400          ' // rebar (coolbar) control
'API per mettere in SLEEP aggiunge un Delay in Millisecondi
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Class_Initialize()
  IsNewComctl32
End Sub
Private Sub Class_Terminate()
   If IsWindow(m_hProgBar) Then DestroyWindow m_hProgBar
End Sub
Property Set Form(f As Form)
   Set mF = f
   m_ParentHwnd = mF.hwnd
   m_Continuos = False
   m_ManualSetting = False
   m_IsCreate = False
   m_Speed = PBSpeed
   m_PB_Color = PBBlu
   m_PB_BackColor = PBGrey
   m_Max = PBM_IterNum
   m_Min = 0
   SpaceCalculate
End Property
'===========================================================================
===
'Propriet� in Scrittura (Input di CLASSE)
Property Let Continuos_Bar(Value As Boolean)
   m_Continuos = Value
End Property
Property Let Speed_AutoPB(Value As Integer)
   If Value < 1 Or Value > 20 Then
      m_Speed = PBSpeed
   Else
      m_Speed = Value
   End If
End Property
Property Let Min(Value As Long)
    m_Min = Value
End Property
Property Let Max(Value As Long)
    m_Max = Value
End Property
Property Let Color(Value As Long)
    m_PB_Color = Value
End Property
Property Let BackColor(Value As Long)
    m_PB_BackColor = Value
End Property
Property Let ManualPosition(Value As Boolean)
   m_ManualSetting = Value
End Property
'===========================================================================
===
'Propriet� in Lettura (Output di CLASSE)
Property Get Hwnd_ProgressBar() As Long
   Hwnd_ProgressBar = m_hProgBar
End Property
Property Get ValuePercentage() As Integer
   ValuePercentage = m_Percentage
End Property
Property Get ValueAbsolute() As Long
   ValueAbsolute = m_Absolute
End Property
'Propriet� FACOLTATIVE
'per attivarle togliere l'APICE
'Property Get Form_Width_Pxl() As Long
'   Form_Width_Pxl = mFCOORDS.Width
'End Property
'Property Get Form_Height_Pxl() As Long
'   Form_Height_Pxl = mFCOORDS.Height
'End Property
'Property Get Form_Left_Pxl() As Long
'   Form_Left_Pxl = mFCOORDS.Left
'End Property
'Property Get Form_Top_Pxl() As Long
'   Form_Top_Pxl = mFCOORDS.Top
'End Property
'Property Get X_TwipsToPixel() As Integer
'    X_TwipsToPixel = mptTwipsPerPixel.x
'End Property
'Property Get Y_TwipsToPixel() As Integer
'    Y_TwipsToPixel = mptTwipsPerPixel.y
'End Property
'Property Get X_Resolution() As Long
'    X_Resolution = mptCurrentScreen.x
'End Property
'Property Get Y_Resolution() As Long
'    Y_Resolution = mptCurrentScreen.y
'End Property
Public Sub AutomaticProgress()
  Static bRunning As Boolean
  Dim dwIncrement As Long
  Dim dwItins As Long
  Dim dwIdx As Long
  On Error GoTo Out
  If bRunning Then bRunning = False: Exit Sub
  m_Max = PBM_Max: m_Min = PBM_Min
  bRunning = CreateProgressBar
  ' Set the value of the highlight increment. We''ll set it to 100
  ' itins here for the example even though it's the default value.
  dwIncrement = m_Max / PBM_IterNum
  SendMessage m_hProgBar, PBM_SETSTEP, ByVal dwIncrement, 0
  For dwIdx = PBM_Min To PBM_Max
    If Not bRunning Then Exit For
    'Delay
    Sleep m_Speed
    SendMessage m_hProgBar, PBM_SETPOS, ByVal dwIdx, 0
  Next
Out:
  If IsWindow(m_hProgBar) Then DestroyWindow m_hProgBar
  bRunning = False
End Sub
Public Sub Value(pbValue As Long)
  Dim Position As Long
  On Error GoTo Out
  Position = GetPos(pbValue)
  If m_IsCreate And Position < PBM_Max Then
      'Il Delay sotto pu� essere rimosso
      '=================================
      'Sleep m_Speed * 2
      '=================================
      SendMessage m_hProgBar, PBM_SETPOS, ByVal Position, 0
      RetValue pbValue
  ElseIf m_IsCreate And Position >= PBM_Max Then
      RetValue m_Max
      DestroyWindow m_hProgBar
      m_hProgBar = 0
      m_IsCreate = False
  ElseIf Not m_IsCreate Then
      m_IsCreate = CreateProgressBar
  End If
Exit_here:
   Exit Sub
Out:
  If IsWindow(m_hProgBar) Then DestroyWindow m_hProgBar
  m_IsCreate = False
End Sub
Public Sub Resize()
  ' If we have a progress bar, adjust it's width & height w/ the form
  If IsWindow(m_hProgBar) Then
      If Not m_ManualSetting Then SpaceCalculate
      MoveWindow m_hProgBar, m_Left, m_Top, m_Width, m_Height, True
    ' Display the progress bar's current size
  End If
End Sub
Public Function ProgressInStatus(StatusHwnd As Long, StatusPanel_Num As
Byte) As Boolean
    'Passando l'Hwnd della STATUS e il N� di PANNEL
    'restituisce le COORDINATE per il calcolo
    'dimensionale del PANEL in cui inserire la PB
    Dim PnlCoords As Coords
    Dim rct As RECT
    If StatusHwnd = 0 Then
      ProgressInStatus = False
      Exit Function
    End If
    If StatusPanel_Num + 1 > GetParts(StatusHwnd) Then
        ProgressInStatus = False
        Exit Function
    Else
        SendMessage StatusHwnd, SB_GETRECT, ByVal StatusPanel_Num, rct
        PnlCoords = RctToCoords(rct)
        With PnlCoords
          m_Width = .Width - cBorderWidthX
          m_Height = .Height - cBorderWidthY
          m_Top = (mF.InsideHeight / mptTwipsPerPixel.Y) - .Height +
cBorderWidthY / 2
          m_Left = .Left + cBorderWidthX / 2
        End With
        ProgressInStatus = True
        m_ManualSetting = True
    End If
End Function
Public Sub SetManualPosition(Left As Long, Top As Long, Height As Long,
Width As Long)
   m_Width = Width / mptTwipsPerPixel.x
   m_Height = Height / mptTwipsPerPixel.Y
   m_Top = Top / mptTwipsPerPixel.Y
   m_Left = Left / mptTwipsPerPixel.x
   m_ManualSetting = True
End Sub
'=======================================================================
'Funzioni e Sub Private
'=======================================================================
Private Sub GetPxNum()
    On Error GoTo HandleErrors
    Dim lngDC As Long
    Dim ptCurrentDPI As POINTAPI
    Const HWND_DESKTOP = 0
    lngDC = GetDC(HWND_DESKTOP)
    If lngDC <> 0 Then
        ' Find the number of pixels in both directions
        ' on the screen, (640x480, 800x600, 1024x768,
        ' 1280x1024?). This also takes into account
        ' the size of the task bar, where ever it is.
        mptCurrentScreen.x = _
         GetSystemMetrics(SM_CXFULLSCREEN)
        mptCurrentScreen.Y = _
         GetSystemMetrics(SM_CYFULLSCREEN)
        ' Get the pixels/inch ratio, as well.
        ptCurrentDPI.x = GetDeviceCaps(lngDC, LOGPIXELSX)
        ptCurrentDPI.Y = GetDeviceCaps(lngDC, LOGPIXELSY)
        mptTwipsPerPixel.x = _
         cTwipsPerInch / ptCurrentDPI.x
        mptTwipsPerPixel.Y = _
         cTwipsPerInch / ptCurrentDPI.Y
    End If
ExitHere:
    Exit Sub
HandleErrors:
    MsgBox err.Number & "  " & err.description
    Resume ExitHere
End Sub
Private Sub GetCoords(cToFill As Coords)
    On Error GoTo HandleErrors
    Dim hWndParent As Long
    Dim rctParent As RECT
    Dim rct As RECT
    hWndParent = GetParent(mF.hwnd)
    Call GetWindowRect(mF.hwnd, rct)
    Call GetWindowRect(mF.hwnd, rctParent)
    With rct
       .Left = .Left - rctParent.Left - cBorderWidthX
       .Top = .Top - rctParent.Top - cBorderWidthY
       .Right = .Right - rctParent.Left - cBorderWidthX
       .Bottom = .Bottom - rctParent.Top - cBorderWidthY
    End With
    cToFill = RctToCoords(rct)
ExitHere:
    Exit Sub
HandleErrors:
    MsgBox err.Number & " " & err.description
    Resume ExitHere
End Sub
Private Function RctToCoords(rct As RECT) As Coords
    ' Convert from a RECT struct to a COORDS struct.
    ' This seems to come up often.
    Dim C As Coords
    With C
        .Left = rct.Left
        .Top = rct.Top
        .Width = rct.Right - rct.Left
        .Height = rct.Bottom - rct.Top
    End With
    RctToCoords = C
End Function
Private Sub SpaceCalculate()
   'Recupera le COORDINATE di posizionamento
   'Standard Fondo FORM
   GetPxNum
   m_Width = mF.InsideWidth / mptTwipsPerPixel.x - 1
   m_Height = 15
   m_Left = 1
   m_Top = mF.InsideHeight / mptTwipsPerPixel.Y - m_Height
End Sub
Private Function GetParts(StatusHwnd As Long) As Integer
   'Recupera il numero di Sezioni o Panel in cui �
   'divisa la STATUS_BAR
  GetParts = SendMessage(StatusHwnd, SB_GETPARTS, 0, ByVal 0)
End Function
Private Sub SetProgressBarColour(ByVal clrref As Long)
   'Imposta il Colore della Progress BAR
   Call SendMessage(m_hProgBar, PBM_SETBARCOLOR, 0&, ByVal clrref)
End Sub
Private Sub SetProgressBackColour(ByVal clrref As Long)
   'Imposta il Colore di SFONDO della Progress BAR
   Call SendMessage(m_hProgBar, PBM_SETBKCOLOR, 0&, ByVal clrref)
End Sub
Private Function IsNewComctl32() As Boolean
' Rtns True if the current working version of Comctl32.dll
' supports the new IE3 sytles & msgs. Rtns False if old version.
' Also ensures that the Comctl32.dll library is loaded for use.
' This hack is much easier than checking the file version...
' VB4 (& VB5 ?) resolves API function names only
' when they're called, not when it compiles code!
  Dim icc As tagINITCOMMONCONTROLSEX
  On Error GoTo OldVersion
  icc.dwSize = Len(icc)
  icc.dwICC = ICC_PROGRESS_CLASS
  ' VB will generate error 453 "Specified DLL function not found"
  ' here if the new version isn't installed.
  IsNewComctl32 = InitCommonControlsEx(icc)
  Exit Function
OldVersion:
  InitCommonControls
End Function
Private Function CreateProgressBar() As Boolean
      'Genera il Riferimento della Progress BAR
      'impostando il RANGE e i colori di DEFAULT
      Dim dwRange As Long
      m_hProgBar = CreateWindowEx(0, PROGRESS_CLASS, _
                                 vbNullString, _
                                 WS_CHILD Or WS_VISIBLE Or IIf(m_Continuos,
PBS_SMOOTH, 0), _
                                 0, 0, 0, 0, mF.hwnd, 0, 0, _
                                 ByVal 0)
      If m_hProgBar = 0 Then
         CreateProgressBar = False
         Exit Function
      End If
      Resize
      SetProgressBarColour m_PB_Color
      SetProgressBackColour m_PB_BackColor
      dwRange = PBM_Min Or PBM_Max * &H10000
      ' Set the range of the progess bar.
      ' (Minimum range = low word, Maximum range = high word).
      SendMessage m_hProgBar, PBM_SETRANGE, 0, ByVal dwRange
      CreateProgressBar = True
End Function
Private Function GetPos(Value As Long) As Long
   'Converte il valore Assoluto Relativo passato
   'in valore PERCENTUALE, in quanto la Progress BAR
   'per semplicit� ha un campo 0...100
   GetPos = Int(100 * Value / (m_Max - m_Min))
End Function
Private Sub RetValue(Value As Long)
   'Restituisce il valore PERCENTUALE
   'e Assoluto Relativo
   m_Percentage = 100 * Value / (m_Max - m_Min)
   m_Absolute = Value
End Sub
Qualcuno mi puo' aiutare?
Grazie
Ciao
Chita

 Chita
Apri un modulo qualsiasi, vai su Strumenti->Riferimenti e guarda se tra le
librerie selezionate ce n'� qualcuna con scritto MANCA:
Se si togli la spunta e cercane una col nome simile, probabilmente
troverai una versione pi� recente.
Poi vai su Debug->Compila e vedi se esce qualche errore.
Ciao.
-Marco-
-- 
questo articolo e` stato inviato via web dal servizio gratuito 
http://www.newsland.it/news
 segnala gli abusi ad 
ab...@newsland.it

 librerie selezionate ce n'� qualcuna con scritto MANCA:
NESSUN OGGETTO MANCANTE
Che fare?????
Grazie
Ciao
Chita


 Chita
Il db funziona bene.
Allora perch� ritieni che i moduli compilati non siano stati convertiti?
Cosa intendi per modulo compilato? E cosa intendi per modulo convertito? 
Manca qualche modulo dopo la conversione ad A2003 o ci sono tutti?
Non funziona pi� qualche sub o function?


 -Marco-

 predefinita:
Ma tutto questo a cosa ti serve? A stampare un report su pdf? Hai provato
a vedere se ci sono sistemi alternativi pi� semplici?
Prova  
http://www.lebans.com/reporttopdf.htm


 ha scritto nel messaggio
news:h6u980$cfo$1...@news.newsland.it...


 ha scritto nel messaggio
news:4a92ac81$0$6161$4faf...@reader5.news.tin.it...


 L'applicativo gira con Windows Xp          Access 2003.
Scrivi DOPO al testo a cui rispondi, non prima, grazie, vedi
http://www.sitocomune.com/
 link ICAA.
Non so perch� non funziona il codice se prima col 97 andava bene, non ho
tempo per provarlo adesso.
Manda un altro post con oggetto "Cambiare da VBA la stampante predefinita"
che questo � fuorviante, o prova una ricerca sui vecchi post, � un tema
che sicuramente sar� gi� stato trattato pi� volte.


 ...
Con A03 ï¿œ molto piï¿œ semplice e breve:
 Cambiare la stampante o le impostazioni stampante/pagina
 
www.donkarl.com/it?FAQ5.1
-- 
HTH
Karl
*********
Access FAQ: 
www.donkarl.com/it
 


Grazie per i consigli! Ho risolto!!!
Ho cancellato tutti i moduli citati in precedenza utilizzando il
suggerimento di Karl, in particolare:
'*********** INIZIO CODICE ************
'salva la stampante originale predefinita in una variabile
Dim strPrinterOld As String
strPrinterOld = Application.Printer.DeviceName
'cambia la stampante predefinita di Access
Application.Printer = Application.Printers("NomeDiAltraStampante")
'alla fine resettare alla stampante predefinita originale
Application.Printer = Application.Printers(strPrinterOld)
'************ FINE CODICE *************
Ancora grazie mille!!!!!