I am using crystal Reports XI. Access database 2000
I have in my VB code
If text = "Customer Name"
report.RecordSortFields.Add report.Database.Tables(1).Fields(2), crAscendingOrder
endif
The above code works fine.
But I would like to use the following so that I do not have to remember the field names position in the report
report.RecordSortFields.Add report.Database.Tables("Customer").Fields("Customer_Name"), crAscendingOrder
When I write this code with field nanmes it gives error message"Type Mismatch".
I do not understand. What is wrong in the code?
I have in my VB code
If text = "Customer Name"
report.RecordSortFields.Add report.Database.Tables(1).Fields(2), crAscendingOrder
endif
The above code works fine.
But I would like to use the following so that I do not have to remember the field names position in the report
report.RecordSortFields.Add report.Database.Tables("Customer").Fields("Customer_Name"), crAscendingOrder
When I write this code with field nanmes it gives error message"Type Mismatch".
I do not understand. What is wrong in the code?