Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Double Clicking on the report fields 1

Status
Not open for further replies.

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.
 
Don't extract it from the formula text. Simply get the parameter value.

- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Ido,

I should have thought of it!!!

Star for you!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top