Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to update a record in a repeating panel?

Status
Not open for further replies.

kramji

MIS
Nov 19, 2002
2
US
Hello All,

I have a form in Approach where I link 2 databases and have records from one database in a repeating panel. Using a button triggered by a macro I try to add values to a field in the repeating panel and these are the steps I use in the Macro

1. Tab to the particular field
2. Create a new record
3. Set the value of the field

Now I would like to do the same thing for another field, but instead of adding a whole new record I would like to update the field value in the same record. I cannot give it all in one macro as I perform some calculations to get these values.

It would be great if someone could let me know if there is a way using a macro to update a record displayed in a repeating panel.

Thank you for all your help.

-K.
 
The macro would have to be run from an object inside the panel. Such an object repeats on each row and the macro will act on fields in the current row. For example you can put a button inside the row and attach the macro to its click event. The button will repeat in each row and act only on the row in which it's clicked.

Otherwise, if you want to start the procedure from outside the panel, it requires script and SQL to select the required repeating panel record(s) and process it/them in memory using a resultset object.

Paul Bent
Northwind IT Systems
 
Thanks for the help Paul.. But I have another problem. On the click of a button I go to another form to perform the calculations and from there when I am done with all the calculations I use a button to return back to my main form which also enables the macro to set the value. So my final macro has this

1. Go back to the main form
2. Tab to the particular field
3. Create a new record
4. Set the value of the field

Sorry if I din make this clear in my last post.

So irrespective of where I put the button, I get the same results, as I go out of the form and come back. Is there a way that I could work out so that instead of using tab to go to the field and set the value, I could somehow go into the repeating panel?

Thanks again for all the help..

-K.
 
I thought you were trying to update the field in an existing repeating panel record. If this is the case and there are one or more fields that identify it uniquely in the rp table then you can store them in variable fields before switching view. If no such fields then add an auto-serial number field to the rp table - doesn't need to be on a view but will give each record an id number.

Then you create a named find on a view (can be hidden) based on the rp table to locate the record stored in the variable field(s). Your macro can switch to this view, run the named find then update the field value before returning to the rp form and finding the original main record.

If you ever get into LotusScript, you can do all this without view switching by making a direct connection to the tables using the Connection, Query and ResultSet classes.

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top