|
-
Mar 26th, 2003, 03:57 PM
#1
Thread Starter
Lively Member
Passing value from desinger to form
i'd like to pass the value get from crsytal report designer to main form. Below is my code:
Code in module
VB Code:
Option Explicit
Public i As Integer
Code in Designer
VB Code:
Option Explicit
Private Sub Section4_Format(ByVal pFormattingInfo As Object)
i = Field7.Value
End Sub
Code in main form
VB Code:
Private Sub Form_Load()
Load form2 'crystal report form
MsgBox i
unload form2
End sub
I get 0 value, which should be 4 (records).
Anyone has idea what's wrong with my code?
Thanks!
"And we know that all things work together for good to them that love God,
to them who are the called according to his purpose. " --- Romans 8:28
-
Mar 26th, 2003, 04:01 PM
#2
Stuck in the 80s
Are you sure the function Section4_Format is being called?
-
Mar 26th, 2003, 04:09 PM
#3
Thread Starter
Lively Member
yeah, you are right. It seems not being called. Do you know how to call it through the main form?
Thanks!
"And we know that all things work together for good to them that love God,
to them who are the called according to his purpose. " --- Romans 8:28
-
Mar 26th, 2003, 04:19 PM
#4
Stuck in the 80s
Is that your full code that you posted?
-
Mar 26th, 2003, 04:26 PM
#5
Thread Starter
Lively Member
I tested again. With code below:
code in main form
VB Code:
Private Sub Form_Load()
Load form2 'crystal report form
'msgbox i ' i comment out this line
unload form2
End sub
code in desiger
VB Code:
Option Explicit
Private Sub Section4_Format(ByVal pFormattingInfo As Object)
i = Field7.Value
msgbox i ' i add this line
End Sub
I get the value from the report in msgbox. So that means function Section4_Format is being called.
The problem is how to let this function talk to main form, seems public variable in module doesn't work. Any idea?
Thanks!
"And we know that all things work together for good to them that love God,
to them who are the called according to his purpose. " --- Romans 8:28
-
Mar 26th, 2003, 04:34 PM
#6
Stuck in the 80s
I don't know. Theoretically, it should work.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|