VB Crystal Report >> How to get Current Field Name

by John Galt » Wed, 04 May 2005 23:33:28 GMT

Has anyone found a way to get the current field NAME when building a
formula.
I want to use the last digit of the field name as a subscript to a
pre-existing array.

i.e. x=Right("FieldName_1",1)

Any other suggestions would be appreciated.

Thanks in advance.
--
John Galt
"Who is John Galt?"




Similar Threads

1. Name of Current Bookmark then create ref field of same name

I have a large number of word docs with quite a few bookmarks in each,
which are used in a document automation system.

I need to print these documents out with a visible marker of where
each bookmark is and what it's called.

>From reading on here, the only way I can see of doing this is to
create a REF field, which is then related to the relevant bookmark.
This then shows up in printing, with the bookmark name, in the same
location as the bookmark, which is what I want.

However, doing this process manually in each document is a bit of a
pain, because I need to get the name of the bookmark first, then
create the field.

Is it possible to write some VB, macro or whatever, to get the name of
the current bookmark (ie where the cursor currently is - Word knows
the bookmark name the cursor is on, so I'm sure we could get it too),
then create a ref field based on that name?

I'm aware I'll still need to walk through each bookmark, but one click
instead of 4 or 5 will save me a lot of time.

ANy help would be greatly appreciated.

2. Getting the current procedure name? - VB.Net

3. Getting current file name and Line number

Hi,
I am trying to get the current file and the line number which is
getting executed. I used:

MessageBox.Show(New StackTrace(New
StackFrame(True)).GetFrame(0).GetFileLineNumber) which gives me the
line number.

Later on,  I was trying to write a generalized routine, so that I can
log the file name and the method.

<code>
Public Function MeAndMyCaller As String
Dim CurrentStack As New System.Diagnostics.StackTrace
Dim Myself As String = CurrentStack.GetFrame(0).GetMethod.Name
Dim MyCaller As String = CurrentStack.GetFrame(1).GetMethod.Name
Dim cur_file As String = CurrentStack.GetFrame(1).GetFileName
Dim line_num As Integer = CurrentStack.GetFrame(1).GetFileLineNumber
Return "In " & Myself & vbCrLf & "Called by " & MyCaller
End Function
</code>

Here, I get MyCaller correctly, but cur_file is not getting returned. I
get a Null exception. line_num is returned as 0, all the time.

What am I doing wrong? Any suggestions/ideas?

Regards,
P

4. Getting current user name - VB.Net

5. Getting name and path of current Active Document in Word

Is there a way to return in a .vbs file the path and name (ActiveDocument.Fullname) of the current ActiveDocument in Word?  Assuming, of course, that just one instance of Word is open.  


6. Getting current file name and Line number - Visual Basic/VB

7. Getting indexes from field names

Is there any way, using DAO, to get the index of a field 
by specifying the field name?  Such a straightforward 
question should have a very simple answer, but it just 
isn't within my grasp right now. 

Thanks!

8. Get current file name and path from current word doc - Word VBA