how to pass text value from form to data report???[urgent]
-
i want to show the text value from form in the data report but i have try many ways it just not working... or data memeber not found. in my data report code i put:
label2.caption= module1.textfromform
textfromform which is a global varible i set in my module1. but having error :"Object required". i try to set the code in form. which is :dareport1.label12.caption=text1.text
but Error:data memeber is not found Hope someone can save me~~~ -
i want to show the text value from form in the data report but i have try many ways it just not working... or data memeber not found. in my data report code i put:
label2.caption= module1.textfromform
textfromform which is a global varible i set in my module1. but having error :"Object required". i try to set the code in form. which is :dareport1.label12.caption=text1.text
but Error:data memeber is not found Hope someone can save me~~~Try declaring your form with the data outside of any sub routines as
Public frm1 as Form1
(or whatever it is that your form is called) & then modifycampbells wrote:
dareport1.label12.caption=text1.text
to
dareport1.label12.caption = frm1.text1.text
-
Try declaring your form with the data outside of any sub routines as
Public frm1 as Form1
(or whatever it is that your form is called) & then modifycampbells wrote:
dareport1.label12.caption=text1.text
to
dareport1.label12.caption = frm1.text1.text
-
Global variables should be avoided. Nevertheless, in your module declare your string variable with either
Public
orFriend
access modifier (Friend if it's withing the same assembly). Then trydareport1.label12.caption = _modulename.variablename_
-
Global variables should be avoided. Nevertheless, in your module declare your string variable with either
Public
orFriend
access modifier (Friend if it's withing the same assembly). Then trydareport1.label12.caption = _modulename.variablename_
i'm using vb6, i think dont have friend this command. It is not working when i put this command dareport1.label12.caption = modulename.variablename it said Method or data memeber not found. I try to check enter the datareport name first then i found that it only link to report properties, can found those label or text in m report...
-
i'm using vb6, i think dont have friend this command. It is not working when i put this command dareport1.label12.caption = modulename.variablename it said Method or data memeber not found. I try to check enter the datareport name first then i found that it only link to report properties, can found those label or text in m report...
I think you misunderstood my code snippet -
_modulename.variablename_
is supposed to represent the public variable in the module you are using to populate your data report, I put it in italics for as an example for you as I don't know what you've named the module or the variable. The point I'm trying to make is, from what I understand, you have a module that populates the data reportPublic Module basDataReport
Public strCaption As String '<--- global string variable
Function GetReportCaption()As String '<--- your method that gets report caption
''''''
''' <--- put your processing here e.g.
'strCaption = blah blah blah
'''''''
Return strCaption '<--- string variable with data
End Sub
End ModuleInside whichever method call it is that you're using to set the caption you could call
MyReport.Caption = basDataReport.strCaption
to get the global variable after it's already been assigned OR if you're using a function like in the example above you could call on the function by name e.g.MyReport.Caption = GetReportCaption()
. See what I mean? -
I think you misunderstood my code snippet -
_modulename.variablename_
is supposed to represent the public variable in the module you are using to populate your data report, I put it in italics for as an example for you as I don't know what you've named the module or the variable. The point I'm trying to make is, from what I understand, you have a module that populates the data reportPublic Module basDataReport
Public strCaption As String '<--- global string variable
Function GetReportCaption()As String '<--- your method that gets report caption
''''''
''' <--- put your processing here e.g.
'strCaption = blah blah blah
'''''''
Return strCaption '<--- string variable with data
End Sub
End ModuleInside whichever method call it is that you're using to set the caption you could call
MyReport.Caption = basDataReport.strCaption
to get the global variable after it's already been assigned OR if you're using a function like in the example above you could call on the function by name e.g.MyReport.Caption = GetReportCaption()
. See what I mean?