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!
|
|
Sharing a tab across views
Posted: 26 Mar 06 1:50 PM
|
prednisolon prednisolon tabletta redirect fiogf49gjkf0d Working on a project where a tab I am using for one MainView (let's say its for Table "A") is nearly identical to the tab I'll need for a second MainView (for Table "B"). When I initially create the Data Form (ie Tab), Architect requires a base table. Once the form is created, you can't change the base table in the form's Properties. So am I stuck creating two nearly identical Data Forms or is there something I'm missing? Thanks! |
|
|
|
Re: Sharing a tab across views
Posted: 27 Mar 06 7:46 AM
|
lamictal and pregnancy birth defects lamictal pregnancy test fiogf49gjkf0d Rick
There is not much you can do. What I do is create a tab based on the main table, copy all the controls from one and past them on the other. Then if you have a grid, you could try to use the BASETABLE to change the BindID property, and modifying the Grid Query.
For example
Put a hidden EditBox (txtEntityID) in the form, and map it to the table id
then
sEntityID = txtEntityID.Text '(I don't know if you have the CurrentID property available in a form. If So you could spare the hidden EditBox and do
sEntityID = frmTab.CurrentID sBaseTable = frmTab.BaseTable sBaseTableIDFieldName = sBaseTable & "ID"
sSQL = grdData.SQL.Text
sSQL = Replace ( sSQL, "WHERE", "WHERE " & sBaseTableIDFieldName & " = '" & sEntityID & "' AND" )
grdData.SQL.Text = sSQL grdData.Refresh
That would cange the Where clause of the grid to filter by the current BaseTable ID (mimic'ing the behavior of having the BindID set up)
E
|
|
|
|
Re: Sharing a tab across views
Posted: 28 Mar 06 6:38 AM
|
fiogf49gjkf0d Eugenio, Thank you - I used your suggestion - creating the form, then copying all the controls to a second form. I moved most of the form's code to a separate vbscript file and added the necessary select case and if/then statements to make it functional for both forms. The result is that what's left in each form's code is almost all event handlers for onclick, onchange, etc. One note for those encountering similar circumstances: After you copy/paste the controls and vbscript into the second form, you still must go to each of the controls' event properties and set the event handlers. Rick |
|
|
|
Re: Sharing a tab across views
Posted: 29 Mar 06 8:15 AM
|
fiogf49gjkf0d Rick,
In the past I just saved my form as a new form, and went into SQL Enterprise Manger and changed the DataCode field to the new table. For example, an ACCOUNT form to be used on Contact: Simply Save as and change the DataCode field from 'ACCOUNT' to 'CONTACT'.
Note, that you will want to bundle this and apply the bundle if you want it to sync out to remotes.
2nd Note. Any bound object properties will have to be rebound using the new table.
Luke |
|
|
|
Re: Sharing a tab across views
Posted: 29 Mar 06 3:30 PM
|
fiogf49gjkf0d How often have you done that? I've been aware of the technique for a while but there was some reason I didn't use it. It could be just paranoia coupled with bad experiences in 4.0 trying to dictate the future. |
|
|
|
Re: Sharing a tab across views
Posted: 29 Mar 06 3:36 PM
|
purchase abortion pill online abortion pill kit click here usa buy abortion pill naloxone compared to naltrexone naloxone vs naltrexone fiogf49gjkf0d I have been doing it since 3.x. The only issue is if you miss a data-bound object. Also, if you are taking a 1 to 1 tab off of the account and re-binding it on the contact side will not update the account data (people tend to forget this). You will have to right SQLs to update the account data from a contact tab. |
|
|
|