ind123p
Programmer
- Sep 28, 2005
- 62
I am using CR XI and access 2000.
I have an application developed in VB 6.0.
This is what I am trying to accomplish.
On double clicking on field in the report I want to open a VB form.
For example. if the user double clicks on Customer ID field, it will open the Customer specific Form.
if the user clicks on Product ID field it will open Product specific form.
I have formula fields on the report. I do not have database fields painted on the report.
The formula is as below:
@col2
Select {?Param2}
Case "CustID": {Customer.CustId}
Case "ProductId"; {Product.ProductId)
default: ""
This is what I have in my CRViewer_dblClicked
Private Sub CRViewer_dblClicked(ByVal x as Long, ByVal y as Long, EventInfo as Variant, UseDefault as Boolean)
Dim numIndex As Long
'Set the EventInfo object to trap the CRviewer event such as click in this case:
Set myEventInfo = EventInfo
'Set the fields collections of the report:
Set myFields = myEventInfo.GetFields
'Assign the index that the user is clicked on:
numIndex = myFields.SelectedFieldIndex
'If the user didn't click on right spot, exit sub:
If numIndex = 0 Then Exit Sub
'Assign the field object to the one clicked on:
Set myField = myFields.Item(numIndex)
'Shows the clicked field name:
MsgBox myField.Name
'Shows the field value(content):
MsgBox myField.Value
End Sub
MY PROBLEM:
My problem is in the myfield.name. I get "Field: @col2". How do I extract the string {Customer.CustId} from this formula text when {?Param2} is CustID ?
Once I know it is CustID, I can load the Customer specific form.
I have an application developed in VB 6.0.
This is what I am trying to accomplish.
On double clicking on field in the report I want to open a VB form.
For example. if the user double clicks on Customer ID field, it will open the Customer specific Form.
if the user clicks on Product ID field it will open Product specific form.
I have formula fields on the report. I do not have database fields painted on the report.
The formula is as below:
@col2
Select {?Param2}
Case "CustID": {Customer.CustId}
Case "ProductId"; {Product.ProductId)
default: ""
This is what I have in my CRViewer_dblClicked
Private Sub CRViewer_dblClicked(ByVal x as Long, ByVal y as Long, EventInfo as Variant, UseDefault as Boolean)
Dim numIndex As Long
'Set the EventInfo object to trap the CRviewer event such as click in this case:
Set myEventInfo = EventInfo
'Set the fields collections of the report:
Set myFields = myEventInfo.GetFields
'Assign the index that the user is clicked on:
numIndex = myFields.SelectedFieldIndex
'If the user didn't click on right spot, exit sub:
If numIndex = 0 Then Exit Sub
'Assign the field object to the one clicked on:
Set myField = myFields.Item(numIndex)
'Shows the clicked field name:
MsgBox myField.Name
'Shows the field value(content):
MsgBox myField.Value
End Sub
MY PROBLEM:
My problem is in the myfield.name. I get "Field: @col2". How do I extract the string {Customer.CustId} from this formula text when {?Param2} is CustID ?
Once I know it is CustID, I can load the Customer specific form.