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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anyone see anything wrong with this formula

Status
Not open for further replies.

B1naryPro

IS-IT--Management
Jan 20, 2002
114
0
0
US
strFormula = "{CAO.DateReceived} in Date(" & Left(strControl, 4) & "," & Mid(strControl, 5, 2) & "," & Right(strControl, 2) & ") to Date(" & Left(strControl2, 4) & ", " & Mid(strControl2, 5, 2) & "," & Right(strControl2, 2) & ")" & " and {CAO.Assignee} = '" & (cboAssignee.Text) & " and {CAO.Status} = '" & (charstr) & "'"

I get runtime error '20515'
The remaining text does not appear to be part of the formula.



JPBinary
MCSE, MCSA
 
Have you declared StrFormula as a variable? Because if you haven't it will generate an error like what you're getting.

Additionally, this formula will generate boolean, which is possibly what you want. But if you're trying to actually assign the above string to StrFormula, remember to put a colon before the first =.

Naith
 
Yes i declared strformula as string
what will the : before the first = do?

thanks


JPBinary
MCSE, MCSA
 
If you're writing in Crystal syntax, := assigns a value to the variable, whereas = compares the current variable to another value. If you are writing in Crystal syntax, omitting the colon would not force an error, but would simply return True or False.

In Basic, you would not need the colon.

You're only showing us part of your formula, I suspect. It'd help if you dropped in the whole thing, and gave a brief synopsis of what you want it to do.

Naith
 
Print out strformula, it should become self-evident.

It gets complicated when you have so much going on, break it down to sections of the record selection formula until all of it works.

-k
 
strFormula = "{CAO.DateReceived} in Date(" & Left(strControl, 4) & "," & Mid(strControl, 5, 2) & "," & Right(strControl, 2) & ") to Date(" & Left(strControl2, 4) & ", " & Mid(strControl2, 5, 2) & "," & Right(strControl2, 2) & ")" & " and {CAO.Assignee} = '" & (cboAssignee.Text) & " and {CAO.Status} = '" & (charstr) & "'"

****************

Also this does not belong in a simple assignment statement
"{CAO.DateReceived} in Date.......

this is more for a record filtering where you only want to see records where some date falls in this range.

Give us the whole formula and describe what it is you are trying to do.



Jim Broadbent
 
strFormula = "{CAO.DateReceived} in Date(" & Left(strControl, 4) & "," & Mid(strControl, 5, 2) & "," & Right(strControl, 2) & ") to Date(" & Left(strControl2, 4) & ", " & Mid(strControl2, 5, 2) & "," & Right(strControl2, 2) & ")" & " and {CAO.Assignee} = '" & (cboAssignee.Text) & " and {CAO.Status} = '" & (charstr) & "'"

************************

Ok on rereading this it appears that this formula is a record selection formula of some kind. This is the record selection formula that you are passing to Crystal through VB...YES?

I am not an expert in this area

strFormula = "{CAO.DateReceived} in Date(" & Left(strControl, 4) & "," & Mid(strControl, 5, 2) & "," & Right(strControl, 2) & ") to Date(" & Left(strControl2, 4) & ", " & Mid(strControl2, 5, 2) & "," & Right(strControl2, 2) & ") and
{CAO.Assignee} = '" & (cboAssignee.Text) & " and {CAO.Status} = '" & (charstr) & "'"

I broke it down a bit to see it better...I think your problem is here with this part...you are missing a single quote

{CAO.Assignee} = '" & (cboAssignee.Text) & "' and

I am also not sure about the () around (cboAssignee.Text) and (charstr)

hope this helps



Jim Broadbent
 
Problems with reports can be related to an unsuccessfully registered DLL which is required for the Crystal report engine that IRB uses. This can happen if IRB is installed using a UserID which did not have Administrative rights on the local machine. It is a relatively simple task to solve this following these steps;

1) Check for the file 'cruflirb.dll' on each installed workstation. It should be in the default 'C:\Program Files\INTO\IRB22' directory (or your custom directory if changed during IRB installation).
If you cannot locate the file, please Contact INTO for further assistance.

2) Manually Register the DLL on each Workstation using the following steps;

- Click the Windows 'START' button then select 'RUN'
- type 'COMMAND.COM' and click OK to start a DOS session
- change to the IRB Directory using 'cd progra~1\INTO\IRB22'
- type the Register command using 'regsvr32 cruflirb.dll'
- when this command is successful, you will receive a messagebox saying;

> DllRegisterServer in cruflirb.dll succeeded.

3) Click okay and type exit into the DOS box to close the window.

4) Now restart IRB, login and go to the Reports Tab and the reports should work correctly. These steps may have to be repeated on other workstations where you wish to run reports. It can also be solved by reinstalling IRB with a UserID that has the correct installtion rights.

 
I'd suggest copying the formula a few times, deleting parts of the code and seeing which bit causes the trouble. Or if none of them do, create a new formula field to re-join the bits.

The human brain can't really think about more than 5 things at the same time, so modularisation is usually a good idea.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top