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

Stack Overflow

Status
Not open for further replies.

kfenner

Technical User
Apr 6, 2003
52
US
Can anyone tell me what this error message means:

"Stack overflow. Your method or procedures are nested too deeply"

Any idea what I am supposed to do to correct it?
 
This usually occurs when you have code that is looping, most commonly by having the code in the wrong place. If you post the code I'll help you figure out the problem.

Perrin
 
I'm going to start from scratch here, because the way I have it set up now just isn't doing what I want it to do anyway. You have been helping me on a form for a "Client.db". I have decided I would like a memo field for notes. However, I don't want this to appear on the primary form that is being used. I would like to use a button on the primary form to bring up the notes for this record. Right now, I set up a separate table for the notes memo field, but the problem is each time you bring it up, a new record is created. Is there a way to put the memo field in the "Client.db" that currently exists, have that field not be on the primary form, but be able to call a different form up from a button showing only the notes field from the table? If not, is there a way to do it using a separate table, like I started to do, but when you call it up, it brings up the record associated with the active record in the Client.db, and doesn't enter a new record each time in the Notes.db? I don't want multiple note records for each record in the Client.db, I only want one that can be edited or viewed regularly.

I know this is getting complicated to explain. I hope I am doing a sufficient job.
 
Yes, this is farily common, if I recall Paradox even came with a sample form that did this. Put a memo field in the client table and don't have it showing on the main form. Then create a separate form with the client table that has only the memo field.

From the button on the main form open the memo form and move to the appropriate record, or I prefer using setRange() to keep the user from moving off that record. Ideally this form should be opened with openAsDialog() and put into a wait() state. This will keep the memo form on top and force the user to close the form before moving back to the client form, this is important so the user does not confuse what record they are working with. Look up openasdialog() in the objectpal help, they have a good example.

Give this a try and if you need help with the code let me know and I'll put something together for you later. I broke my toe this afternoon so I have to keep it brief tonight.

Perrin
 
I am sorry to hear about your toe! It was very nice of you to take the time to answer my questions with that going on. I appreciate it. I'll give this a try now on my own and try not to bother you. If I have any difficulties, I'll let ya know. Thanks!
 
Ok, I tried this, but I obviously am doing something wrong. I don't really know how to use the setRange() as you described. I got it so the form opens, but when I move to the next record in the main form, and open the notes dialogue box, it puts the same notes in the field as the record before. I'm not sure what is happening, therefore I don't know how to fix it. If you need my code, I can give it to you, but thought you might be able to give me an example, and then I could try it on my own again. Sorry to be such a pain.
 
No problem, I'd be glad to help. I'll post some sample code for you in the morning.

Perrin
 
I think I forgot to mention that the memo field must be contained within a table frame. I suggest you use a multi-record table and set it to 1 row and 1 column and the only field in it should be the memo field.


On the client form add this code to a button

method pushButton(var eventInfo Event)
var
f form
endvar

f.openAsDialog("memoForm")
f.client.setRange(clientNumberField) ; this assumes that clientNumberField is the Primary key field in the table and the table frame is named client.

f.wait()
f.close()

endMethod

On the Memo form you should have a button with the code

method pushButton(var eventInfo Event)
formreturn("Ok")
endMethod

This will return control back to the client form.

Give this a try and see how it goes, you should also put the memo form and the field into edit mode when the form is opened.

Perrin
 
Ok, I believe I understand the code. Believe it or not, I ALMOST had it right. Just want to be sure of one thing before I jump back into this. You said the memo field must be in a table frame. So, does this mean the memo is in it's own table, separate from the client table, or is it a field within the client table. You kinda lost me on that part. Thanks for your help!
 
The memo field is a field in the client table. When you create your memo form you must have the memo field contained in the cleint table table frame or multi record object. If you used the wizard to create the form then you may have already done this without realizing it. If the code works then you'r fine.

perrin
 
Ok, I tried the code, and it didn't work. I redesigned the "Notes" form, doing the "table frame" thing. I think I did it right. Still didn't work. I tried again using the form expert. Still didn't work. Here is the code I have:

method pushButton(var eventInfo Event)
var
f form
endvar

f.openAsDialog("Notes1Form")
f.client.setRange(clientField)

f.wait()
f.close()
endmethod

In my "client" table (and it is called that), the client number field is simply named "client". I get the error in the setrange line. Either way - (clientField) or (clientNumberField) it says it is an unknown identifier. I also tried using ("MemoForm") instead of ("Notes1Form"), get same error in setrange line. What am I messing up?
 
I think there is a object name issue here, just for a test add the code clientfield.view() to the button. Does this give you the client number? It should if not that's a problem.

Perrin
 
It still tells me "clientfield" is an unknown identifier. If you think it is an object name issue, tell me where to look to see if I need to fix anything. In the properties box, I'm pretty sure I have everything named the right way. Once again, thanks for the help.
 
Right mouse click on the field and select Properties and see what "Name of object" says if it says "clientfield" then there must be a name conflict somewhere else and I'd suggest trying a different name.

Perrin
 
All fixed!! Don't know what I'd do without you! I'm sure I'll think up more questions but think I'll wait and get them all ready at once! LOL

Once again, thanks so much!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top