General information
Category:
Coding, syntax & commands
>>>>I am having a problem with my form defaults after i run a report after opening a grid.
>>>>the code I have in the click button for the browse grid:
>>>>
>>>>public nOldrec
>>>>THISFORM.appfindbutton.MousePointer=11
>>>>oAgp = CREATEOBJECT("APPGRIDPICK")
>>>>oAgp.Show()
>>>>report form license.frx preview
>>>>GO nOldRec
>>>>THISFORM.appfindbutton.MousePointer=1
>>>>THISFORM.Refresh()
>>>>
>>>>after this codes executes and I want to move forward within the database with my forward command button I get the error message
>>>>Object X is not found.
>>>>X= is the name of the form.
>>>>Apparently the form object is not getting reset after I run the report, how can I remedy this so it gets reset after the code is run?
>>>>Any help would be appreciated.
>>>>thanks,
>>>>
>>>>Alp Berker
>>>>Systems Analyst
>>>>Conseco Inc.
>>>
>>>Could you post the code which actually triggers the error? Also, what is oAgp? Another form?
>>
>>Sure Edward,
>>&cCmdObj..cmdnavigate.Next.enabled = .T.
>>where &cCmdObj in the macro substitution has a value of x, the name of the form.
>>oAgp is a form defined in a class. I am instantiating the form to display the grid class.
>>sorry for not being more specific.
>>regards,
>>
>>Alp Berker
>>Systems Analyst
>>Conseco Inc.
>
>Bacically, you cannot use constructions like Myform.cmd...., because Myform is not always the correct reference to the form's object. When you outside a form and want to refer to it, you should either path Thisform to this snippet (e.g. procedure) or have some mechanism to find the proper object reference, e.g. searching through _SCREEN.Forms collection.
Edward,
I don't think I am going outside the form. The command button calls a utility program which executes the above code. I believe when the report is run, the deafaults are lost since the report form.. destroys the defaults. Apparently the report makes it loose the form name. the other buttons when used work fine,
only this button looses the form object name.
So I believe you are saying insert thisform an assign it to x (where x is the form name) before it executes this code? as in
thisform.x? before the code.
thanks for the clarification and help.
regards,
Alp Berker
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only