The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Application.Forms - Calling a form element from another form
Posted: 13 Apr 09 12:52 PM
|
I am trying to call a form from another form using the application.Forms function. Heres the code [code] dim Form Set Form = Application.Forms("Personal:packagetypeadmin") Form.txtfile.text = "test data" [/code]
I was able to get this to work with other forms, but when I try it on my newly created form "packagetypeadmin" I get the following error:
Object required: Form
at line: Form.txtfile.text "test data"
Thanks for your time!
|
|
|
| |
| |
|
Re: Application.Forms - Calling a form element from another form
Posted: 24 Apr 09 6:00 AM
|
Having the same issue. I have been using application.forms... for ages in a 6.2 database. Now it is upgraded t 7.51 and this just does not want to know. I have out in ryans sample "set controls actoss forms..." the GetForm Function and that fails too with "FRM", tried giving this different variable name too.
Any attempt to use application.forms to set a property fails. Tried nominating the SQL property of the datagrird instead of the bindid as well. However it nevers gets to that since application.forms fails
|
|
|
|
Re: Application.Forms - Calling a form element from another form
Posted: 24 Apr 09 6:01 AM
|
Having the same issue. I have been using application.forms... for ages in a 6.2 database. Now it is upgraded t 7.51 and this just does not want to know. I have put in ryans sample "set controls across forms..." the GetForm Function and that fails too with "FRM", tried giving this different variable name too.
Any attempt to use application.forms to set a property fails. Tried nominating the SQL property of the datagrird instead of the bindid as well. However it nevers gets to that since application.forms fails
|
|
|
|
Re: Application.Forms - Calling a form element from another form
Posted: 24 Apr 09 6:04 AM
|
Having the same issue. I have been using application.forms... for ages in a 6.2 database. Now it is upgraded t 7.51 and this just does not want to know. I have put in ryans sample "set controls across forms..." the GetForm Function and that fails too with "FRM", tried giving this different variable name too.
Any attempt to use application.forms to set a property fails. Tried nominating the SQL property of the datagrird instead of the bindid as well. However it nevers gets to that since application.forms fails
|
|
|
| |
|
Re: Application.Forms - Calling a form element from another form
Posted: 24 Apr 09 1:26 PM
|
dim Formo, X Set Formo = Application.Forms("System:Opportunity Detail") X = cINT("0" & Formo.NumSitesCount.TEXT)
IF X > 0 THEN SelectFirstRecordForGrid(dgWORK)
works from a tab view.
Maybe you have to get a 'connection'/reference to the mainview in the collection first if you go after another mainview.....say you are on a Contact TAB and need Opportunity Detail info.... |
|
|
|
Re: Application.Forms - Calling a form element from another form
Posted: 25 Apr 09 2:46 AM
|
But... Does it work if on a MAIN View form you try to refernce a TAB form, to set a property or indeed read one from tab, which is what I am trying to do. To explain further .. I have a New Main Form with its own Datgrid on it, this lists Contracts. When the grid is clicked I capture the ContractID,
Then it has to change the BINDID on a datagrid within a TAB with the captured ContractID to popluate with data from a related table.
Set The grid application.forms("Contract:MyPluginTabName").myDatagrid.bindid = strValue
If i put the datagrid onto the main form - and remove reference to Application.forms - then all is well.
Now here is the real bizarre one...... I made a new 626 main form, detail view and tab to do the same sort of thing, it worked in 626, bundled and moved to my slx751 database it worked, but my original - no chance still OBJECT REQUIRED
|
|
|
| |
|
Re: Application.Forms - Calling a form element from another form
Posted: 25 Apr 09 10:14 AM
|
Thanks for reply and yes I have tried this .. Dim OBJProduct set OBJProduct = Application.Forms("Contract:SLX75_ContractRenewalProducts") OBJProduct.DGproducts.bindid = "DUM123456789"
and then in says "Object Required : OBJProduct", which is something I have seem many times over 3 days of trying to fix this. I have even started again (building froms from scratch in 751 and still get this problem
The difference is that you are setting a the Main View Detail Form, whereas I trying to use a tab form, I think.
|
|
|
|
Re: Application.Forms - Calling a form element from another form
Posted: 25 Apr 09 10:55 AM
|
It looks like if there is only one tab present (as per earlier test), then all is well, since this tab must have focus BUT if there mutliple tabs then IF the form being set has focus - then it works, but if does not have focus then it fails
|
|
|
|