Passing variables from one screen to another

B

Brutus

I have a website for our employees with a database for tracking the location
of equipment with numerous fields. I allow selected visitors to enter data
and then I need to have them change the location field as the equipment
moves from one place to another. All is written in ASP.

I can add records and search records fine but I am having problems reading
in a record, changing the contents of one field (chosen by the employee from
a drop down menu) and then writing the results as a new record.

I am using <INPUT Type=Hidden Name="T2" Value='T2'> where 'T2' is
(supposedly) the contents of a field of the record returned in a search.
This is in a separate routine. If I substitute text for 'T2' and put it in
quotes like "Test" it passes fine. I think I am not assigning variable
correctly.

Any help?

Dave
 
S

Stefan B Rusynko

<INPUT Type=Hidden Name="T2" Value='T2'>
means use the text value of T2 for the form field named T2
If the value is coming from a DB you need to get it as an ASP variable and set is as an ASP variable
After connecting to the DB
<% T2=objRS("T2")%>
Then
<INPUT Type=Hidden Name="T2" Value="<%=T2%>">

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


|I have a website for our employees with a database for tracking the location
| of equipment with numerous fields. I allow selected visitors to enter data
| and then I need to have them change the location field as the equipment
| moves from one place to another. All is written in ASP.
|
| I can add records and search records fine but I am having problems reading
| in a record, changing the contents of one field (chosen by the employee from
| a drop down menu) and then writing the results as a new record.
|
| I am using <INPUT Type=Hidden Name="T2" Value='T2'> where 'T2' is
| (supposedly) the contents of a field of the record returned in a search.
| This is in a separate routine. If I substitute text for 'T2' and put it in
| quotes like "Test" it passes fine. I think I am not assigning variable
| correctly.
|
| Any help?
|
| Dave
|
|
 
B

Brutus

Thank you for your response.

My problem (I think) is that I have used FP to handle the query and display
the results. It uses some script it generates to display a table with the
results and it appears that the variable is never really set.

Since FP handles all the record stuff I can't use <% T2=objRS("T2")%> unless
I reopen the database??

I will post the junk FP generates if you aren't familiar with it.

Dave
 
S

Stefan B Rusynko

Sound like you are using the DBR Wizard
- yes the DB variable is set from the DB by the wizard
For some tips on using the DBRW fields see
http://spiderwebwoman.com/resources/dbrwtipsandtricks.asp
and http://spiderwebwoman.com/thingumajig/tweaks.htm

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Thank you for your response.
|
| My problem (I think) is that I have used FP to handle the query and display
| the results. It uses some script it generates to display a table with the
| results and it appears that the variable is never really set.
|
| Since FP handles all the record stuff I can't use <% T2=objRS("T2")%> unless
| I reopen the database??
|
| I will post the junk FP generates if you aren't familiar with it.
|
| Dave
|
| | > <INPUT Type=Hidden Name="T2" Value='T2'>
| > means use the text value of T2 for the form field named T2
| > If the value is coming from a DB you need to get it as an ASP variable and
| > set is as an ASP variable
| > After connecting to the DB
| > <% T2=objRS("T2")%>
| > Then
| > <INPUT Type=Hidden Name="T2" Value="<%=T2%>">
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > | > |I have a website for our employees with a database for tracking the
| > location
| > | of equipment with numerous fields. I allow selected visitors to enter
| > data
| > | and then I need to have them change the location field as the equipment
| > | moves from one place to another. All is written in ASP.
| > |
| > | I can add records and search records fine but I am having problems
| > reading
| > | in a record, changing the contents of one field (chosen by the employee
| > from
| > | a drop down menu) and then writing the results as a new record.
| > |
| > | I am using <INPUT Type=Hidden Name="T2" Value='T2'> where 'T2' is
| > | (supposedly) the contents of a field of the record returned in a search.
| > | This is in a separate routine. If I substitute text for 'T2' and put it
| > in
| > | quotes like "Test" it passes fine. I think I am not assigning variable
| > | correctly.
| > |
| > | Any help?
| > |
| > | Dave
| > |
| > |
| >
| >
|
|
 
B

Brutus

Thanks for the links. I "borrow" ideas from spiderwoman all the time - it's
a great resource. In looking through the references there I still can't
find a solution. Once I let DBRW do a search and display the results I
can't seem to access the variables for the various fields displayed.

Dave

Stefan B Rusynko said:
Sound like you are using the DBR Wizard
- yes the DB variable is set from the DB by the wizard
For some tips on using the DBRW fields see
http://spiderwebwoman.com/resources/dbrwtipsandtricks.asp
and http://spiderwebwoman.com/thingumajig/tweaks.htm

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Thank you for your response.
|
| My problem (I think) is that I have used FP to handle the query and
display
| the results. It uses some script it generates to display a table with
the
| results and it appears that the variable is never really set.
|
| Since FP handles all the record stuff I can't use <% T2=objRS("T2")%>
unless
| I reopen the database??
|
| I will post the junk FP generates if you aren't familiar with it.
|
| Dave
|
| | > <INPUT Type=Hidden Name="T2" Value='T2'>
| > means use the text value of T2 for the form field named T2
| > If the value is coming from a DB you need to get it as an ASP variable
and
| > set is as an ASP variable
| > After connecting to the DB
| > <% T2=objRS("T2")%>
| > Then
| > <INPUT Type=Hidden Name="T2" Value="<%=T2%>">
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > | > |I have a website for our employees with a database for tracking the
| > location
| > | of equipment with numerous fields. I allow selected visitors to
enter
| > data
| > | and then I need to have them change the location field as the
equipment
| > | moves from one place to another. All is written in ASP.
| > |
| > | I can add records and search records fine but I am having problems
| > reading
| > | in a record, changing the contents of one field (chosen by the
employee
| > from
| > | a drop down menu) and then writing the results as a new record.
| > |
| > | I am using <INPUT Type=Hidden Name="T2" Value='T2'> where 'T2' is
| > | (supposedly) the contents of a field of the record returned in a
search.
| > | This is in a separate routine. If I substitute text for 'T2' and
put it
| > in
| > | quotes like "Test" it passes fine. I think I am not assigning
variable
| > | correctly.
| > |
| > | Any help?
| > |
| > | Dave
| > |
| > |
| >
| >
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top