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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FormManager DTC

Status
Not open for further replies.

computergeek

Programmer
May 23, 2001
193
CA
Hello,

Does anyone know how to run an user-defined function from inside the Form Manager when one of your buttons is clicked?

I am trying to set a hidden field with a value from the current record. After the "Save" button is pressed the FormManager currently does an updaterecord(), followed by a requery() you are then placed at the beginning of the recordset and not on your current row! (This is a bug when using Identity colums - Microsoft's workaround it to do the requery()) I want to get the current value for the company_name, use this value to get the company_id and somehow go to that record...

I am beginning to think I should have used code, rather than using a DTC!!

Any ideas?

Thanks in advance.
 
Hi,

It's ComputerGeek. Yes, I was able to execute a function from the FormManager DTC.

 
I have not used the form manager, as it seemed a bit cumbersome for what it was trying to do.

Just create an onclick event subroutine for the update button, and add the required code.

Anyway, there are two ways of providing a value to a hidden field on the Server-Side code - 1 just add a global variable (ie not in a function/sub), and set its value wherever you need to, then add

<input type=&quot;hidden&quot; value=&quot;<%=m_Value%>&quot;>

(I use the m_ variable prefix for module-wide scope values.)

Or you can use the properties tab of a PageObjectDTC to create a variable that you can set/get. At least it remembers its value during server round-trips. You need to set your variable to have 'page' scope - which dynamically generates hidden fields for you. (Content Management)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top