J
James
I've got a Class Module "DBAdmin" and a form "Administration". I have a
public string variable in the dbadmin and i want to use it in
administration msgbox.
'This is the Administration form
Private Sub cmdImportOfferings_Click()
Dim dbUtils As New DBAdmin
If dbUtils.ImportXML("C:\Offerings Project\offerings.xml") Then
MsgBox "Offerings XML successfully imported"
Else
'it doesn't lke the next line
MsgBox DBAdmin.ErrorMsg
End If
Set dbUtils = Nothing
End Sub
-----------------------------
'this is the DBAdmin Class Module
Dim ErrorMsg As String
Public Function ImportXML(FileName As String) As Boolean
On Error GoTo Error_Handler
'Dim appAccess As New Access.Application
'appAccess.ImportXML DataSource:=fileName,
ImportOptions:=acStructureAndData
Application.ImportXML FileName, acStructureAndData
ImportXML = True
Exit_Method:
Set appAccess = Nothing
Exit Function
Error_Handler:
ImportXML = False
ErrorMsg = Err.Description
GoTo Exit_Method
End Function
Thanks.
public string variable in the dbadmin and i want to use it in
administration msgbox.
'This is the Administration form
Private Sub cmdImportOfferings_Click()
Dim dbUtils As New DBAdmin
If dbUtils.ImportXML("C:\Offerings Project\offerings.xml") Then
MsgBox "Offerings XML successfully imported"
Else
'it doesn't lke the next line
MsgBox DBAdmin.ErrorMsg
End If
Set dbUtils = Nothing
End Sub
-----------------------------
'this is the DBAdmin Class Module
Dim ErrorMsg As String
Public Function ImportXML(FileName As String) As Boolean
On Error GoTo Error_Handler
'Dim appAccess As New Access.Application
'appAccess.ImportXML DataSource:=fileName,
ImportOptions:=acStructureAndData
Application.ImportXML FileName, acStructureAndData
ImportXML = True
Exit_Method:
Set appAccess = Nothing
Exit Function
Error_Handler:
ImportXML = False
ErrorMsg = Err.Description
GoTo Exit_Method
End Function
Thanks.