Modifing Records using Request Forms

tazzy30tazzy30 Member Posts: 52
Hello,

I am tring to use a request form to change values within the country table. I have created a request form with the variables:
Var1: OldCountryCode (data type code 10 and this one has a TableRelation Country)
Var2: NewCountryCode (data type code 10)

If a user selects a value in var1 and then inserts a new value in Var2, when the report is previewed it will modify the field selected with the new value within the country table.

Is this possible, if so whats the best way to go about it?

Comments

  • SavatageSavatage Member Posts: 7,142
    can you explain more why you want to do it this way, as compared to simply going into the country table or form and making your change there?

    you want a whole report just to change 1 code at a time?
  • tazzy30tazzy30 Member Posts: 52
    Thank you for your reply,

    the reason being is that there are over 250 country code's to go though not all need amending. I have a list of codes that need chaning and was hoping to be able to change them via a report
  • SavatageSavatage Member Posts: 7,142
    still according to the first post - someone will select the bad code & enter the new code & hit preview to make the change.
    why not go into form 10 & just change it? Seems like less work to me.

    Here's a list I have. you could dataport then in or use the excel importer in the download section
    http://savatage99.googlepages.com/countrycodes.xls
  • tazzy30tazzy30 Member Posts: 52
    Thank you for your reply, but can fields be modified via a request form for future reference?
  • SavatageSavatage Member Posts: 7,142
    are you trying to change the code (which is the primary key)?


    to answer you question Yes it can be done.

    for example I have a request form where I enter a value 'Hello'

    onafterget record I could
    validate("FieldToChange",EnteredValue);
    modify;

    but unless your MASS CHANGING a report is not the way to go.
  • DenSterDenSter Member Posts: 8,304
    tazzy30 wrote:
    can fields be modified via a request form for future reference?
    Technically it can be done yes (assuming that I interpret your request correctly and you are looking to modify a record by the use of a report, and want to collect user input on the options tab of the request form of that report), but I can't think of any reason why you'd want to do it that way. Even if you provide two lookup forms to enter the values you want to change, you'd still have to wade through all the records in the table. Might as well give them a Card form and a List form for looking up the record they want to modify.

    Just use list forms and card forms to modify data. It'll make your life much easier.
  • SavatageSavatage Member Posts: 7,142
    I agree 8)
    Savatage wrote:
    still according to the first post - someone will select the bad code & enter the new code & hit preview to make the change.
    why not go into form 10 & just change it? Seems like less work to me.
  • DenSterDenSter Member Posts: 8,304
    I hear ya brutha :mrgreen: (trying to use Desmond's accent 8) )
  • garakgarak Member Posts: 3,263
    Why do you not use the OnPreDataItem Section for modify?

    RecVariable.setrange(FieldTofilter,OldValue);
    RecVariable.modifyall(FieldToFilter,NewValue);
    Do you make it right, it works too!
Sign In or Register to comment.