I have a multi-step form that allows a user to edit data stored in a table. In step 1, they enter the key for the record they are going to modify. The form validation queries the database to make sure that value exists. If it doesn't, we throw an error. But if it does, it brings up the form for editing the record. At this point, I could call the same query I did in the form validation and use the result to populate the default values in the form. However, I was hoping I could get those values from the validation query I ran in step 1 and not have to run the query a second time.

I explored form_set_value, and I confirmed I was using it correctly because I changed the value of the key from step 1. It just did not allow me to set the values in step 2.

I'm sure the answer is out there somewhere, but I have been digging for so long I am about to pull my hair (what little I have) out. Any thoughts?