Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Getting specific field in CrystalReports (shorthand)

Posted on 2003-11-25
9
Medium Priority
?
267 Views
Last Modified: 2010-05-01
Is there a shorthand method of doing similar to below...

Database.Tables.Item(1).Fields.Item(31).Value

Item 31 is the email field.  I want to specify the field name instead of doing a loop beforehand to get the item number (In case I add a field later).

Similar to rsRecordset("Email")
0
Comment
Question by:ketapillar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 3

Expert Comment

by:magnus23
ID: 9819716
Hi ketapillar
I believe this will work
Database.Tables.Item(1).Fields!Email
0
 
LVL 3

Author Comment

by:ketapillar
ID: 9820921
Nope...  Doesn't work :(
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 9820960
Which version and edition of CR?

Which method of displaying the report?  RDC?

This used to work but I think in the later versions it was deleted
Database.Tables.Item(1).Fields("Email ")

mlmcc
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 3

Author Comment

by:ketapillar
ID: 9824910
I'm using version 9 and RDC.

The Database.Tables.Item(1).Fields("Email ") doesn't work either...
0
 
LVL 3

Author Comment

by:ketapillar
ID: 9824936
Increased pointz
0
 
LVL 3

Author Comment

by:ketapillar
ID: 10285247
PAQ with this as answer

'This function returns the value within a database field.
'   Created 2003/11/26  brr
Public Function GetDBFieldValue(strFieldName As String, Optional intDatabaseNumber As Integer) As Variant
    Dim x As Integer
   
    If intDatabaseNumber < 2 Then intDatabaseNumber = 1
   
    For x = 1 To Database.Tables.Item(intDatabaseNumber).Fields.Count
        If UCase(Database.Tables.Item(intDatabaseNumber).Fields.Item(x).Name) = UCase("{pvwMembersC." & strFieldName & "}") Then
            GetDBFieldValue = Database.Tables.Item(intDatabaseNumber).Fields.Item(x).Value
            Exit Function
        End If
    Next x
End Function
0
 

Accepted Solution

by:
amp072397 earned 0 total points
ID: 10618848
PAQed, with points refunded (100)

Thanks very much!
amp, ee admin, amp*at*experts-exchange.com
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question