L
Luka
Hello,
I have problem with defining Labels Names in MyReport.
There is MyReport with a lot of Labels with Names:
ZNAK1, Datum1, Pos1, IME1
ZNAK2, Datum2, Pos2, IME2
ZNAK3, Datum3, Pos3, IME3
and so on
I created Function SPREMEMBE (ZNAK, Datum, Pos, IME) to be
called many times from Function aa() with different
parameters-representing Label Names.
I want parameters (ZNAK, Datum, Pos, IME) to be used as
Label Names in MyReport. But I do not know how to define
Type of parameter (or how to Set it), to be understood as
Name of Label in MyReport.
Code as follow get Error MsgBox that Report!LabelName is
not recognized-does not exist.
Please help.
Global MyForm As Form
Global MyReport As Report
-----------------------------------------------------------
Function aa()
Set MyForm = New [Form_Some Form]
MyForm.Caption = "KEY"
MyForm.RecordSource = "Query......"
MyForm.Visible = True
DoCmd.OpenReport "Some_Report", acPreview, "", ""
Set MyReport = Reports![ Some_Report ]
SPREMEMBA "ZNAK1", "Datum1", "Poz1", "IME1" 'Params as
strings!?
'After additional procedure-next calling
SPREMEMBA "ZNAK2", "Datum2", "Poz2", "IME2"
SPREMEMBA "ZNAK3", "Datum3", "Poz3", "IME3"
|
|
'and so on
End Function
----------------------------------------------------------
Function SPREMEMBA (ZNAK, Datum, Poz, IME)
MyReport!ZNAK.Visible = True 'HERE ERROR OCCURES
MyReport!ZNAK.Caption = Left(MyForm!Opomba, InStr(MyForm!
Opomba, "$") - 1)
MyReport!Datum.Visible = True
MyReport!Datum.Caption = MyForm!Datum
MyReport!Poz.Visible = True
MyReport!Poz.Caption = Right(MyForm!Opomba, Len(MyForm!
Opomba) - InStr(MyForm!Opomba, "$"))
If ((MyForm!IME) Like "AAA*") Then
MyReport!IME.Caption = "AAAAAAAA"
Exit Function
End If
If ((MyForm!IME) Like "BBB*") Then
MyReport!IME.Caption = "BBBBBBB"
Exit Function
End If
End Function
I have problem with defining Labels Names in MyReport.
There is MyReport with a lot of Labels with Names:
ZNAK1, Datum1, Pos1, IME1
ZNAK2, Datum2, Pos2, IME2
ZNAK3, Datum3, Pos3, IME3
and so on
I created Function SPREMEMBE (ZNAK, Datum, Pos, IME) to be
called many times from Function aa() with different
parameters-representing Label Names.
I want parameters (ZNAK, Datum, Pos, IME) to be used as
Label Names in MyReport. But I do not know how to define
Type of parameter (or how to Set it), to be understood as
Name of Label in MyReport.
Code as follow get Error MsgBox that Report!LabelName is
not recognized-does not exist.
Please help.
Global MyForm As Form
Global MyReport As Report
-----------------------------------------------------------
Function aa()
Set MyForm = New [Form_Some Form]
MyForm.Caption = "KEY"
MyForm.RecordSource = "Query......"
MyForm.Visible = True
DoCmd.OpenReport "Some_Report", acPreview, "", ""
Set MyReport = Reports![ Some_Report ]
SPREMEMBA "ZNAK1", "Datum1", "Poz1", "IME1" 'Params as
strings!?
'After additional procedure-next calling
SPREMEMBA "ZNAK2", "Datum2", "Poz2", "IME2"
SPREMEMBA "ZNAK3", "Datum3", "Poz3", "IME3"
|
|
'and so on
End Function
----------------------------------------------------------
Function SPREMEMBA (ZNAK, Datum, Poz, IME)
MyReport!ZNAK.Visible = True 'HERE ERROR OCCURES
MyReport!ZNAK.Caption = Left(MyForm!Opomba, InStr(MyForm!
Opomba, "$") - 1)
MyReport!Datum.Visible = True
MyReport!Datum.Caption = MyForm!Datum
MyReport!Poz.Visible = True
MyReport!Poz.Caption = Right(MyForm!Opomba, Len(MyForm!
Opomba) - InStr(MyForm!Opomba, "$"))
If ((MyForm!IME) Like "AAA*") Then
MyReport!IME.Caption = "AAAAAAAA"
Exit Function
End If
If ((MyForm!IME) Like "BBB*") Then
MyReport!IME.Caption = "BBBBBBB"
Exit Function
End If
End Function