dinz Posted October 21, 2004 Posted October 21, 2004 Hi Guys... Appreciate very much for your help I have 2 SQL tables. A table to store records and the other is to store a choice of selection. I use a Menu/List control which list the selection from a choice SQL table. This works fine in Adding function, user are able to select the listed values by a click at the combo button. The problem is in the Editing function. How can make the Menu/List control show the stored value of the record instead of the first value of the choice. Quote
borfast Posted October 21, 2004 Posted October 21, 2004 I'm not sure I understand your problem. Isn't that just a matter of grabbing the list options from the other table? Quote
dinz Posted October 25, 2004 Author Posted October 25, 2004 Thanks Raul. As I have mentioned, I have 2 SQL tables. A table to store all records named Bpt and a table to store all available bays in the area is named Bay. In DWMX the recordsets are rsBpt and rsBptBay respectively. In the Edit form the List/Menu Dynamic selection are as follows: Options from Recordset : rsBptBay Values : Bay Labels : Bay Select value equal to : <%= (rsBpt.Fields.Item("Bay").Value) %> The code behind this control is : <select name="menuBay" id="menuBay"> <% While (NOT rsBptBay.EOF) %> <option value="<%=(rsBptBay.Fields.Item("Bay").Value)%>" <%If (Not isNull((rsBpt.Fields.Item("Bay").Value))) Then If (CStr(rsBptBay.Fields.Item("Bay").Value) = CStr((rsBpt.Fields.Item("Bay").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rsBptBay.Fields.Item("Bay").Value)%></option> <% rsBptBay.MoveNext() Wend If (rsBptBay.CursorType > 0) Then rsBptBay.MoveFirst Else rsBptBay.Requery End If %> </select> When the form is saved and run the first record of rsBptBay is shown in the List/Menu control not the value of the rsBpt field. I hope this will help. Once again Thanks ... Quote
dinz Posted October 25, 2004 Author Posted October 25, 2004 Hi Raul. Thanks for everything ... My apology I found my mistake. The field of the two SQL tables character size was different. It is now working. I really appreciate your help. Thanks again. Quote
TCH-Bruce Posted October 25, 2004 Posted October 25, 2004 Glad you got it working. Welcome to the family and forums. Quote
TCH-Rob Posted October 25, 2004 Posted October 25, 2004 Dinz, Welcome to the forums and welcome home. Good to see it working. Quote
TCH-Don Posted October 25, 2004 Posted October 25, 2004 Welcome to the Family Dinz and your new home! We really are like family here. So if you need anything, just ask your new family! We love to help Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.