Jump to content

Recommended Posts

Posted

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.

Posted

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 ...

Posted

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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...