HELP!!!! (OpenInsight 32-bit Specific)
At 07 DEC 2009 09:11:15AM Marty Rosenbloom wrote:
Hi,
I keep getting "error opening dictionary" messages. The offending control is always a calculated field. All the answers for my calculated fields have been changed to @Ans=0. I remove the database association for the offending control. If it has an event attached to it, I will disable it. The error is then transferred to another control. I checked tab order and disabled the previous control. Nothing seems to help. There are 220 controls on this form. I am using OI7.2.
TIA,
Marty
At 08 DEC 2009 08:33AM Jared Bratu wrote:
Do you think the problem is on the form or in the dictionary itself? Here are two questions that should help point us in the right direction.
Can you open the dictionary in the table builder? If not, verify the dictionary table is attached. Open the system editor and check there is a table named "DICT.YOURTABLENAME" listed.
Do other forms that use this table have problems? If you create a test form and bind it to the field will the form function?
At 08 DEC 2009 11:41AM Marty Rosenbloom wrote:
Hi,
Thanks for the response. The dictionary can be opened and modified. I did create a test form and after much frustration discovered that it was the previous control in the tab order that was causing the problem. The previous control, as well as the control that gave the error message are calculated fields. The control that showed up as the error message is called MID_COMMISSION and the previous control is called TOTAL_SALES. The algorithm in TOTAL_SALES is the culprit.
I am using RLIST to gather information from another table and apparently this calculated field doesn't like it. I tested script on a button control and debugger and it works to my satisfaction.
The key field in TABLE_MAIN is WEEK_ENDING while the key in the SALES table is ORDER_NUMBER. WEEK_ENDING is a column in the SALES table.
The code that I use is:
Declare Subroutine RList
Date={WEEK_ENDING}
If Date=' Then @Ans=0
Sales='
Date=OConv(Date, "D2/")
Cmd1=SELECT SALES WITH WEEK_ENDING EQ "
Cmd2=Quote(Date)
Statement= Cmd1:Cmd2
Rlist(Statement,5,
,
,'')Done=0
List='
Loop
Readnext @ID Else
Done=1
End
Until Done Do
List:=@FM:@ID
Repeat
List1,1="
Pos=1
Flag='
Loop
Remove Key From List At Pos Setting FlagSales:=@FM:XLate("SALES", Key, "NET_SALE", "X")While FlagRepeat
Sales1,1='
Convert @VM To @FM In Sales
Weekly_Sales=Sum(Sales)
@Ans=Weekly_Sales
This works fine (except for @Ans) in the 'click' event of a button using a debug. What am I doing wrong? Is there another way to obtain the data from the SALES table for NET_SALE?
Sorry for rambling, frustration level is high!
Thanks,
Marty
At 09 DEC 2009 02:34AM Warren Auyong wrote:
I would recommend doing a Push.Select / Pop.Select outside your first loop. And I would use some other variable (e.g. RecID ) instead of @ID.
It might be advisable to save @ID, @RECORD, @ID at the beginning and restore them before exiting.
Do you really need two loops?
At 09 DEC 2009 03:51AM Simon Wilmot wrote:
Hi Marty,
I would suggest that maybe when you check for a null blank you skip the rest of the processing.
Eg
If Date=' then
@Ans=0End else
..@Ans=Weekly_SalesEnd
Regards,
Simon
At 09 DEC 2009 12:31PM Marty Rosenbloom wrote:
You are correct about the two loops. I saw that while reviewing everything. I am going to look into the push.select/pop.select. The other alternative is to use a data base control and do these calculations as event driven. Not my first choice.
Thanks,
Marty