so habe ich es versucht:
es treten folgende Fehler auf:
unzulässige Verwendung von NULL in form_open
InitFontList: DLL-Einsprungpunkt 61 in msaccess.exe
Objectvariable oder with-Blockvariable nicht festgelegt
Weiß mir keinen Rat mehr. Bin für jede Hilfe dankbar. Danke im Vorraus
Quellcode
- Option Compare Database
- Option Explicit
- Declare Function wlib_GetDC Lib "user32" Alias "GetDC" (ByVal hWnd As Long) As Long
- Declare Function wlib_GetFontCount Lib "msaccess.exe" Alias "#61" (ByVal hdc As Long) As Long
- Declare Function wlib_GetFontList Lib "msaccess.exe" Alias "#62" (ByVal hdc As Long, fiFonts() As wlib_FONTINFO) As Long
- Declare Function wlib_ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hWnd As Long, ByVal hdc As Long) As Long
- Declare Function wlib_GetSizeCount Lib "msaccess.exe" Alias "#63" (ByVal hdc As Long, ByVal szFont As String) As Long
- Declare Function wlib_GetSizeList Lib "msaccess.exe" Alias "#64" (ByVal hdc As Long, ByVal szFont As String, lSizeList() As Long) As Long
- Declare Sub wlib_AccChooseColor Lib "msaccess.exe" Alias "#53" (ByVal hWnd As Long, rgb As Long)
- Declare Function wlib_FTwipsFromFont Lib "msaccess.exe" Alias "#67" (ByVal stFontName As String, ByVal iSize As Long, ByVal iWeight As Long, ByVal fItalic As Long, ByVal fUnderline As Long, ByVal cch As Long, ByVal stCaption As String, ByVal cchUseMaxWidth As Long, dx As Long, dy As Long) As Integer
- Declare Function wlib_GetDeviceCaps Lib "gdi32" Alias "GetDeviceCaps" (ByVal hdc As Long, ByVal nIndex As Long) As Long
- Declare Function wlib_GetSystemMetrics Lib "user32" Alias "GetSystemMetrics" (ByVal nIndex As Long) As Long
- Dim rgfiFonts() As wlib_FONTINFO
- Global wlib_rgaii() As WLIB_ADDININFO
- Global mlbl_mlbi As MLBL_INFO
- Global wlib_caii As Integer
- Type WLIB_POINT
- x As Long
- Y As Long
- End Type
- Type MLBL_INFO
- StRptName As String
- fBrowse As Integer
- iLabelId As Integer
- fUserSizes As Integer
- fMetric As Integer
- fDotMatrix As Integer
- fPortrait As Integer
- cItemsAcross As Integer
- stFontName As String
- iFontSize As Integer
- iFontWeight As Integer
- lFontColor As Long
- fItalic As Integer
- fUnderline As Integer
- dytextbox As Integer
- dxGrid As Integer
- dyGrid As Integer
- fUsrPrefsChng As Integer
- fOpenGroupBox As Integer
- ptLabelSize As WLIB_POINT
- dxdySpace As WLIB_POINT
- xLeftMargin As Integer
- xRightMargin As Integer
- yTopMargin As Integer
- ptOrigin As WLIB_POINT
- End Type
- Type STYL_CONTROLSIZINGINFO
- stFontName As String
- iFontSize As Integer
- iFontWeight As Integer
- fFontItalic As Integer
- fFontUnderline As Integer
- stCaption As String
- cch As Integer
- iBorderStyle As Integer
- iBorderWidth As Integer
- iSpecialEffect As Integer
- cchUseMaxWidth As Integer
- dxLine As Long
- dyLine As Long
- dxBorder As Long
- dyBorder As Long
- End Type
- Type WLIB_ADDININFO
- stName As String
- rsStrings As Recordset
- stStringsField As String
- End Type
- Type wlib_FONTINFO
- fRasterFont As Long
- rgstName As String * 32
- End Type
- Global styl_xPixelPerInch As Integer
- Global styl_yPixelPerInch As Integer
- Global styl_xTwipsPerPixel As Integer
- Global styl_yTwipsPerPixel As Integer
- Sub wlib_SmartCtlPropSet(ByRef ctl As Control, stProp As String, vVal As Variant)
- ' Setze im Control (z.B. Feld) "Ctl" das Property "stProp" auf den Wert "vVal"
- ' z.B: Setze im Feld "Me!bxcolor" das Property "Backcolor" auf den entsprechenden Wert
- If (ctl.Properties(stProp) <> vVal) Then ctl.Properties(stProp) = vVal
- End Sub
- Function wlib_StFromSz(szTmp As String) As String
- Dim ich As Integer
- ich = InStr(1, szTmp, vbNullChar, vbBinaryCompare)
- If ich Then
- wlib_StFromSz = Left$(szTmp, ich - 1)
- Else
- wlib_StFromSz = szTmp
- End If
- End Function
- Function wlib_StFromAccessIds(ID As Long) As String
- On Error GoTo wlib_StFromAccessIds_Err
- wlib_StFromAccessIds = Application.AppLoadString(ID)
- wlib_StFromAccessIds_Exit:
- Exit Function
- wlib_StFromAccessIds_Err:
- wlib_StFromAccessIds = ""
- Resume wlib_StFromAccessIds_Exit
- End Function
- Public Function SchriftBestimmen(Optional I As Integer = 1) As String
- On Error GoTo Err_Click
- 'Dim FeldBEZ
- 'FeldBEZ = "VBFT" & CStr(I)
- 'If Not Nz(dlookup(FeldBEZ, "VB-Firma"), "") = "" Then
- ' SchriftBestimmen = dlookup(FeldBEZ, "VB-Firma")
- 'Else
- SchriftBestimmen = "Arial,10,Falsch,Falsch"
- 'End If
- Exit_Click:
- Exit Function
- Err_Click:
- msgbox Err.Description
- Resume Exit_Click
- End Function
- Public Function SchriftZuweisen()
- Dim Steuerelement As Control
- On Error GoTo Err_Click
- Dim Schriftart As String, Schriftgr, Schriftfett, Schriftkursiv
- Dim SchriftInfo As String
- Dim I%, i1%, i2%, i3%, Zaehler%, z$
- msgbox "TEst"
- SchriftInfo = SchriftBestimmen(1)
- For I = 1 To Len(SchriftInfo)
- z = Mid$(SchriftInfo, I, 1)
- If z = "," Then
- Zaehler = Zaehler + 1
- If Zaehler = 1 Then
- i1 = I
- End If
- If Zaehler = 2 Then
- i2 = I
- End If
- If Zaehler = 3 Then
- i3 = I
- End If
- End If
- Next I
- Schriftkursiv = Mid$(SchriftInfo, i3 + 1, Len(SchriftInfo))
- Schriftfett = Mid$(SchriftInfo, i2 + 1, i3 - i2 - 1)
- Schriftgr = Mid$(SchriftInfo, i1 + 1, i2 - i1 - 1)
- Schriftart = Mid$(SchriftInfo, 1, i1 - 1)
- With Steuerelement
- .FontName = Schriftart
- .FontSize = Schriftgr
- .FontBold = Schriftfett
- .FontItalic = Schriftkursiv
- End With
- Exit_Click:
- Exit Function
- Err_Click:
- msgbox Err.Description
- Resume Exit_Click
- End Function
- Public Function Schriftart1() As String
- Schriftart1 = SchriftAnalyse(1, "Art")
- End Function
- Public Function Schriftart2() As String
- Schriftart2 = SchriftAnalyse(2, "Art")
- End Function
- Public Function Schriftart3() As String
- Schriftart3 = SchriftAnalyse(3, "Art")
- End Function
- Public Function Schriftkursiv1() As Boolean
- Schriftkursiv1 = SchriftAnalyse(1, "kursiv")
- End Function
- Public Function Schriftkursiv2() As Boolean
- Schriftkursiv2 = SchriftAnalyse(2, "kursiv")
- End Function
- Public Function Schriftkursiv3() As Boolean
- Schriftkursiv3 = SchriftAnalyse(3, "kursiv")
- End Function
- Public Function Schriftfett1() As Boolean
- Schriftfett1 = SchriftAnalyse(1, "fett")
- End Function
- Public Function Schriftfett2() As Boolean
- Schriftfett2 = SchriftAnalyse(2, "fett")
- End Function
- Public Function Schriftfett3() As Boolean
- Schriftfett3 = SchriftAnalyse(3, "fett")
- End Function
- Public Function SchriftGroesse1() As Integer
- SchriftGroesse1 = SchriftAnalyse(1, "Größe")
- End Function
- Public Function SchriftGroesse2() As Integer
- SchriftGroesse2 = SchriftAnalyse(2, "Größe")
- End Function
- Public Function SchriftGroesse3() As Integer
- SchriftGroesse3 = SchriftAnalyse(3, "Größe")
- End Function
- Public Function SchriftAnalyse(SchriftNr As Integer, Info As String)
- 'Dim Schriftart As String, Schriftgr As Integer, Schriftfett As Boolean, Schriftkursiv As Boolean
- On Error GoTo Fehler
- Dim SchriftInfo As String
- Dim I%, i1%, i2%, i3%, Zaehler%, z$
- SchriftInfo = SchriftBestimmen(SchriftNr)
- For I = 1 To Len(SchriftInfo)
- z = Mid$(SchriftInfo, I, 1)
- If z = "," Then
- Zaehler = Zaehler + 1
- If Zaehler = 1 Then
- i1 = I
- End If
- If Zaehler = 2 Then
- i2 = I
- End If
- If Zaehler = 3 Then
- i3 = I
- End If
- End If
- Next I
- Select Case Info
- Case "kursiv"
- SchriftAnalyse = Mid$(SchriftInfo, i3 + 1, Len(SchriftInfo))
- Case "fett"
- SchriftAnalyse = Mid$(SchriftInfo, i2 + 1, i3 - i2 - 1)
- Case "Größe"
- SchriftAnalyse = Mid$(SchriftInfo, i1 + 1, i2 - i1 - 1)
- Case "Art"
- SchriftAnalyse = Mid$(SchriftInfo, 1, i1 - 1)
- End Select
- fehler2:
- Exit Function
- Fehler:
- msgbox Err.Description
- End Function
es treten folgende Fehler auf:
unzulässige Verwendung von NULL in form_open
InitFontList: DLL-Einsprungpunkt 61 in msaccess.exe
Objectvariable oder with-Blockvariable nicht festgelegt
Weiß mir keinen Rat mehr. Bin für jede Hilfe dankbar. Danke im Vorraus