Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

# Compare variable's value in crystal......

Posted on 2000-04-21
Medium Priority
166 Views
I tried to wrote same formula in 2 different ways but unfortunately it didn't run.
It gives me below mentioned error when i try to preview my report.

1)Error: Numeric Overflow.

StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
If chr({table_site.child_site2site}) = X then
{table_site.name}
Else
""
Else
""

2)Error:The String is non-numeric.

StringVar X;
If {table_site.x_site_group} = "Bldg" then
X := chr({table_site.objid})
Else If {table_site.x_site_group} = "Tenant" then
If {table_site.child_site2site} = ToNumber(X) then
{table_site.name}
Else
""
Else
""

Let me know as soon as you can.

Thanks,
bhavesh55
0
Question by:bhavesh55
[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
• 2

LVL 3

Expert Comment

ID: 2738267
If you hit debug it might tell you what line caused the error.
Also it might help anyone trying to help you to know what the "types" of your data items are.

Guess 1)
Chr(charcode)
The required charcode argument is a Long that identifies a character.
table_site.objid could be something other than a long.

Guess 2)
X := is a Pascal construct, not VB

Do you need to know twice?
0

LVL 3

Accepted Solution

3rsrichard earned 300 total points
ID: 2738296
see above
0

Author Comment

ID: 2745984
3rsrichard
I am talking about crystal report not vb.

anyway, i will give you point.

Thanks,
0

## Featured Post

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
###### Suggested Courses
Course of the Month9 days, 20 hours left to enroll