NetTalk Central

Author Topic: Open a form from a browse on a different table  (Read 2773 times)

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Open a form from a browse on a different table
« on: September 07, 2013, 06:51:06 PM »
Hi

I have two tables SBBPM (prefix of SBB6:) and SBBBM (prefix of SBB2:)...

I have a browse on the primary table SBBPM which is joined to SBBBM. The view button for this browse opens up a form for the SBBPM table.

One of the other fields on the browse is from the SBBBM table and I wanted to set that field's 'on click' to open up a popup form that is for the SBBBM table.

How do I pass the unique key to the form so it knows what record to open?

Note... I do have a separate browse on the SBBBM table that does open this same form without any problem. So I'm basically trying to call this form from a related table.

Thanks for any help.
Lee

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #1 on: September 07, 2013, 07:00:30 PM »
Also...

The field in the browse is SBB2:BOOK_Name, but what I'm guessing I need to pass to the form is SBB2:SYSID which is the unique key that form is on.

Thanks

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Open a form from a browse on a different table
« Reply #2 on: September 08, 2013, 09:56:40 PM »
I think what you are saying is that you have a browse with two tables, the primary table and the secondary table,
and you want the form button to open the secondary table form, not the primary table form?

the easiest way to do this (by far) is to reconstruct the browse so the secondary table becomes the primary, and the primary becomes the secondary.

cheers
Bruce

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #3 on: September 09, 2013, 04:26:57 AM »
Bruce

Bruce

Not quite correct,  this browse (lets call it browse A)  has its OWN form on the primary table but one of the columns (which is from the secondary table) I want to open a different form (lets call it form B). I was using the 'on click' tabe for that column to try and open form B.

FYI.. I also have a separate browse procedure on this secondary table as (browse B) with the form B. So basically I'm trying to open form B from two different browses

Browse A (primary table A, secondary table B) --- FORM A  (using view button)
                                                                           --- FORM B  (on click of one of the columns)

Browse B (primary table B)                                --- FORM B

Hope this makes it clearer.

Thanks
Lee

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Open a form from a browse on a different table
« Reply #4 on: September 09, 2013, 09:24:05 PM »
clearer yes - but I think you'll need to post a small example showing the technique so I can see how you might be able to do that.

cheers
Bruce

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #5 on: September 10, 2013, 04:25:56 AM »
Bruce

Sure... I work something up.

Thanks
Lee

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #6 on: September 10, 2013, 11:41:33 AM »
Bruce

Here's the app, dct, and tps files.

Once you compile  run if you click on the browsefileB from the menu and then click on any of values in the rows for column 'A_sys_id" it will open up the UpdateFormA. I'm not sure how to configure the BrowseFileB column 'onclick' to pass and open the correct related entry for UpdateFormA.

On BrowseFileB ..,.if you click on the standard insert/change/delete buttons it will open up UpdateFormB which is the standard Browse / Form relation.

[attachment deleted by admin]

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #7 on: September 12, 2013, 12:43:15 PM »
Bruce

Just wondering if you had a chance to look at this.

Thanks
Lee

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: Open a form from a browse on a different table
« Reply #8 on: September 12, 2013, 09:57:29 PM »
Hi Lee,

tip: your example was complicated by your naming structure. Between File A and File B I was going cross-eyed trying to figure out what was what. In future just give the files something reasonable as a name. I changed everything to "Parents" and 'Relations" and it got much easier to understand.

As it happens the solution is very simple, it's a matter of getting the "parameters" to the on-click correct.

'Change_btn=Change__btn&Fil:SysID=' & Fil:SysID

The first part tells the receiving form that it should be in "change mode" (not insert or delete mode or something.) Without this the form won't load the record. The second part (after the &) tells the receiving form what the ID is of the field we want to edit.

Incidentally this same URL would work if you made the Parent "Name" clickable - you don't have to show the parent ID.

Cheers
Bruce

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #9 on: September 13, 2013, 04:27:49 AM »
Bruce

Sorry about that, I was just trying to get the example setup and didn't really think about any sort of naming issue.

I want to open this in view mode, so would it be 'View_btn=View_btn&fil:sysid=' & fil:sysid.

I plan on only using the Parent "Name' on the browse, I just was showing the id for illustration purposes.

BTW... Good luck at DevCon... would have loved to go.

Thanks
Lee

LSlowick

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Email
Re: Open a form from a browse on a different table
« Reply #10 on: September 13, 2013, 04:38:57 AM »
Bruce

That solution worked perfectly.

Thanks
Lee