NetTalk Central

Author Topic: Insert without a form  (Read 3220 times)

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Insert without a form
« on: April 04, 2023, 06:52:56 AM »
Hi,

To insert a record, starting from a browse, normally a form is used.
I would like to have a select-popup directly when I click the insert button under the browe.
I have no need for a form here. I don't even want it.
Is that achievable?

Cheers,
Ren?

Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Insert without a form
« Reply #1 on: April 04, 2023, 10:17:05 PM »
You can set the "form" to be used for Insert, Change and Delete separately.
(See the button settings on the browse.)

"Selecting" from a popup though isn't going to "Insert" a record. You'd need to code that.
Frankly, I'd create a simple Form on the table, with just the one field (the lookup browse), then in ValidateInsert I'd add code o prime the record with whatever values you are choosing, and let it add the record.

that seems like the simplest architecture to me.

Bruce

Rene Simons

  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: Insert without a form
« Reply #2 on: April 04, 2023, 10:41:04 PM »
Hi BRuce,

So, do you think it possible to create an update form with just a lookup browse?
Then when I select, a record, is it possible to simulate clicking the save button on the form or do I have to click it myself?

Ren?


Rene Simons
NT14.14

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: Insert without a form
« Reply #3 on: April 26, 2023, 10:42:39 AM »
I just did something very similar to what you are describing. My solution was to put my browse inside a from and add a lookup field to the from. I also included an "Add" button as I wanted my users to be able to type in the correct information too.

It should also be possible to include a button on your form that will call your lookup browse and add the record. I haven't done this myself but look at the "LookupAbility  Routine" inside your lookup browse to get an idea of what to set to put it in lookup mode. Once the lookup has happened your primary key should be in a session value.

Matthew
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template