Forums
This topic is locked
List/Menu Update Detail Page
Posted 11 Apr 2002 16:31:58
1
has voted
11 Apr 2002 16:31:58 Shirley Van Vleck posted:
I have created an insert page with a field using a menu. I then created an update page and included a menu for that field. Instead of the selection from the insert page showing up as the chosen one, the first item in the menu shows up. I know it is reading what was selected from the inserted menu correctly and placing it into the database. If you do not re choose what was in the menu from the insert page, when you update the page it changes the data to the first selection in the menu.I'm sure I'm leaving out a step somewhere. My radio buttons hold the data from the insert page to the update page.
I hope this makes sense to someone.
Thank you for any help anyone can give me.
Replies
Replied 11 Apr 2002 18:17:10
11 Apr 2002 18:17:10 David Behan replied:
Two solutions to this as far as I know...
A. Set the value of the combo box equal to a field value.
B. Structure list as follows:
1 Name = Currently: <%=(rsConnection.Fields.Item("fieldx".Value)%> / Value = <%=(rsConnection.Fields.Item("fieldx".Value)%>
2 Name = Option1 / Value = Option1
3 Name = Option2 / Value = Option2
4 Name = Option3 / Value = Option3
etc.
So it will be the same as you have it except add in a line at the top saying "Currently: (and the value in the database)" and set the value to the same value. You basically will reinput the same value on top of the existing value when they submit, unless they change it. This is ok because the value they update to in the database is the same as the value their before.
Does that make sense. Hope so... any more help just reply and I'll run you through it.
Regards,
_________________________
David Behan - www.bmor.com
A. Set the value of the combo box equal to a field value.
B. Structure list as follows:
1 Name = Currently: <%=(rsConnection.Fields.Item("fieldx".Value)%> / Value = <%=(rsConnection.Fields.Item("fieldx".Value)%>
2 Name = Option1 / Value = Option1
3 Name = Option2 / Value = Option2
4 Name = Option3 / Value = Option3
etc.
So it will be the same as you have it except add in a line at the top saying "Currently: (and the value in the database)" and set the value to the same value. You basically will reinput the same value on top of the existing value when they submit, unless they change it. This is ok because the value they update to in the database is the same as the value their before.
Does that make sense. Hope so... any more help just reply and I'll run you through it.
Regards,
_________________________
David Behan - www.bmor.com
Replied 11 Apr 2002 20:31:21
11 Apr 2002 20:31:21 Shirley Van Vleck replied:
This is what I put in the code. I know I have misunderstood what you were telling me because the Currently and Value are yellow.
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<select name="lstStatus">
Currently: <%=(rsWrksht11.Fields.Item("tstatus".Value)%> / Value = <%=(rsWrksht11.Fields.Item("tstatus".Value)%>
<option value="01">Good Standing</option>
<option value="02">Non-inscribed Reprimand</option>
<option value="03">Inscribed Reprimand</option>
</select>
</font></div>
lstStatus is the name of the menu, tstatus is the name of the field in the Worksheet11 table, rsWrksht11 refers to the recordset I created from the table Worksheet11 including tstatus as a field.
Thank you for your quick reply. I really need to get this working correctly very soon as I have a presentation in a couple of days.
Thanks again,
Shirley
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Two solutions to this as far as I know...
A. Set the value of the combo box equal to a field value.
B. Structure list as follows:
1 Name = Currently: <%=(rsConnection.Fields.Item("fieldx".Value)%> / Value = <%=(rsConnection.Fields.Item("fieldx".Value)%>
2 Name = Option1 / Value = Option1
3 Name = Option2 / Value = Option2
4 Name = Option3 / Value = Option3
etc.
So it will be the same as you have it except add in a line at the top saying "Currently: (and the value in the database)" and set the value to the same value. You basically will reinput the same value on top of the existing value when they submit, unless they change it. This is ok because the value they update to in the database is the same as the value their before.
Does that make sense. Hope so... any more help just reply and I'll run you through it.
Regards,
_________________________
David Behan - www.bmor.com
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<select name="lstStatus">
Currently: <%=(rsWrksht11.Fields.Item("tstatus".Value)%> / Value = <%=(rsWrksht11.Fields.Item("tstatus".Value)%>
<option value="01">Good Standing</option>
<option value="02">Non-inscribed Reprimand</option>
<option value="03">Inscribed Reprimand</option>
</select>
</font></div>
lstStatus is the name of the menu, tstatus is the name of the field in the Worksheet11 table, rsWrksht11 refers to the recordset I created from the table Worksheet11 including tstatus as a field.
Thank you for your quick reply. I really need to get this working correctly very soon as I have a presentation in a couple of days.
Thanks again,
Shirley
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Two solutions to this as far as I know...
A. Set the value of the combo box equal to a field value.
B. Structure list as follows:
1 Name = Currently: <%=(rsConnection.Fields.Item("fieldx".Value)%> / Value = <%=(rsConnection.Fields.Item("fieldx".Value)%>
2 Name = Option1 / Value = Option1
3 Name = Option2 / Value = Option2
4 Name = Option3 / Value = Option3
etc.
So it will be the same as you have it except add in a line at the top saying "Currently: (and the value in the database)" and set the value to the same value. You basically will reinput the same value on top of the existing value when they submit, unless they change it. This is ok because the value they update to in the database is the same as the value their before.
Does that make sense. Hope so... any more help just reply and I'll run you through it.
Regards,
_________________________
David Behan - www.bmor.com
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 11 Apr 2002 20:35:24
11 Apr 2002 20:35:24 David Behan replied:
I knew I didn't explain myself correctly, sorry. Here is your code redone to work (I hope):
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<select name="lstStatus">
<option value="Currently: <%=(rsWrksht11.Fields.Item("tstatus".Value)%>"><%=(rsWrksht11.Fields.Item("tstatus".Value)%></option>
<option value="01">Good Standing</option>
<option value="02">Non-inscribed Reprimand</option>
<option value="03">Inscribed Reprimand</option>
</select>
</font></div>
Hope this works for you!!!
_________________________
David Behan - www.bmor.com
Edited by - beano on 11 Apr 2002 20:36:01
<div align="center"><font face="Arial, Helvetica, sans-serif" size="2">
<select name="lstStatus">
<option value="Currently: <%=(rsWrksht11.Fields.Item("tstatus".Value)%>"><%=(rsWrksht11.Fields.Item("tstatus".Value)%></option>
<option value="01">Good Standing</option>
<option value="02">Non-inscribed Reprimand</option>
<option value="03">Inscribed Reprimand</option>
</select>
</font></div>
Hope this works for you!!!
_________________________
David Behan - www.bmor.com
Edited by - beano on 11 Apr 2002 20:36:01
Replied 11 Apr 2002 22:33:09
11 Apr 2002 22:33:09 Shirley Van Vleck replied:
Thank you for helping me with the code. It works.
I have tried to make some modifications and so far have not been able to make those work. I had the value as a code 01 and the label as Good Standing. When I try to change 01 to Good Standing, because when my client see the 01 they won't have a clue what it means, I get an error. I have gone back into my database and made the changes there so I shouldn't have a conflict. My drop down will look like:
01
Good Standing
Non Inscribed Reprimand
Inscribed Reprimand
Like I said as long as I leave the number as the value it works. If I choose Inscribed Reprimand then when I go back into the update page my menu looks like this
03
Good Standing
Non Inscribed Reprimand
Inscribed Reprimand
If you have any suggestions please let me know. I find myself going in circles.
Thank you again for your help.
Shirley
I have tried to make some modifications and so far have not been able to make those work. I had the value as a code 01 and the label as Good Standing. When I try to change 01 to Good Standing, because when my client see the 01 they won't have a clue what it means, I get an error. I have gone back into my database and made the changes there so I shouldn't have a conflict. My drop down will look like:
01
Good Standing
Non Inscribed Reprimand
Inscribed Reprimand
Like I said as long as I leave the number as the value it works. If I choose Inscribed Reprimand then when I go back into the update page my menu looks like this
03
Good Standing
Non Inscribed Reprimand
Inscribed Reprimand
If you have any suggestions please let me know. I find myself going in circles.
Thank you again for your help.
Shirley
Replied 12 Apr 2002 11:26:41
12 Apr 2002 11:26:41 David Behan replied:
In your database set up a table called tbl_status. In that table have to fields:
1. st_id (autonumber)
2. st_status (text, 100)
On your page first create a recordset called "rsStatus", for the above table and sort it by id or status. Then insert a combo box. Select the server behaviours and choose "Dynamic Elements - Dynamic List/Menu". In the pop up box select your recordset "rsStatus". Set Get Labels From "st_status" and Get Values From "st_id". If your are doing this on an update page you can set the value equal to a field in another recordset by clicking the lighting sign beside the last box.
Your inserted code should look like this:
<select name="status">
<%
While (NOT RsStatus.EOF)
%>
<option value="<%=(rsStatus.Fields.Item("st_id".Value)%>"><%=(rsStatus.Fields.Item("st_status".Value)%></option>
<%
RsStatus.MoveNext()
Wend
If (RsStatus.CursorType > 0) Then
RsStatus.MoveFirst
Else
RsStatus.Requery
End If
%>
</select>
Hope this helps...
_________________________
David Behan - www.bmor.com
Edited by - beano on 12 Apr 2002 11:32:25
1. st_id (autonumber)
2. st_status (text, 100)
On your page first create a recordset called "rsStatus", for the above table and sort it by id or status. Then insert a combo box. Select the server behaviours and choose "Dynamic Elements - Dynamic List/Menu". In the pop up box select your recordset "rsStatus". Set Get Labels From "st_status" and Get Values From "st_id". If your are doing this on an update page you can set the value equal to a field in another recordset by clicking the lighting sign beside the last box.
Your inserted code should look like this:
<select name="status">
<%
While (NOT RsStatus.EOF)
%>
<option value="<%=(rsStatus.Fields.Item("st_id".Value)%>"><%=(rsStatus.Fields.Item("st_status".Value)%></option>
<%
RsStatus.MoveNext()
Wend
If (RsStatus.CursorType > 0) Then
RsStatus.MoveFirst
Else
RsStatus.Requery
End If
%>
</select>
Hope this helps...
_________________________
David Behan - www.bmor.com
Edited by - beano on 12 Apr 2002 11:32:25