Forum Moderators: open

Message Too Old, No Replies

Recordset Dropdown

         

smoove

12:57 am on Jan 5, 2005 (gmt 0)

10+ Year Member



I am trying to change the choices in a recordset dropdown menu for the date. It only has 2003 and 2004. I have been messing with this for days. If you need more info, let me know. I would greatly appreciate ANY help.

CaseyRyan

3:13 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



Hello smoove,
could you please post the code that you are using and give some explanations around each piece?

-=casey=-

smoove

4:38 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



Here is the code for the dropdown. I did not design this page so I don't know how helpful I can be. It is a fillable form that writes to an access db. Let me know any other info that would be helpful. Thanks.

<select name="apply_year" class="mysoma-dropdown" id="apply_year" onBlur="makeAppDate()" onChange="makeAppDate()">
<option value="" <%If (Not isNull(Year(now()))) Then If ("" = CStr(Year(now()))) Then Response.Write("SELECTED") : Response.Write("")%>></option>
<%
While (NOT rs_date_applicationyear.EOF)
%>
<option value="<%=(rs_date_applicationyear.Fields.Item("year_number").Value)%>" <%If (Not isNull(Year(now()))) Then If (CStr(rs_date_applicationyear.Fields.Item("year_number").Value) = CStr(Year(now()))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_date_applicationyear.Fields.Item("year_number").Value)%></option>
<%
rs_date_applicationyear.MoveNext()
Wend
If (rs_date_applicationyear.CursorType > 0) Then
rs_date_applicationyear.MoveFirst
Else
rs_date_applicationyear.Requery
End If
%>
</select>

CaseyRyan

5:32 pm on Jan 5, 2005 (gmt 0)

10+ Year Member




Whatever is being used to popuplate rs_date_applicationyear is what is defining the list of years that are displayed.

In order to change the years displayed you need to change the data that is going into that. So, if you wanted 2005 to be in that list, you'd add it to the table that rs_date_applicationyear.Fields.Item("year_number") is being pulled from.

-=casey=-

smoove

9:11 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



Thanks for the fast reply! Within the recordset, in the SQL area it says this:

SELECT *
FROM unity_date_year_list
WHERE year_number > 'MMColParam' AND year_number < 'MaxYearNum'

The db "unity_date_year_list" goes well beyond 2005. Originally there was MaxYearNum variable set to 2005, even though it never displayed 2005 as an option. I have deleted the variables in my attempts to fix this. Please give me anymore input that you may have, as I am very appreciative for your time.

CaseyRyan

9:20 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



I would put the variable back in. I would also change the greater than (>) and less than (<) signs to greater than or equal to (<=) and less than or equal to (<=). This way, the list you return will include the years specified by MaxYearNum and MMColParam.

The code would end up looking like the following:


SELECT *
FROM unity_date_year_list
WHERE year_number >= 'MMColParam' AND year_number <= 'MaxYearNum'

-=casey=-

smoove

9:49 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



I changed the SQL code as you suggested...nothing. I don't remember what the Run-time Value for the variables, so it won't except them. Any suggestions?

CaseyRyan

10:15 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



I don't remember what the Run-time Value for the variables,

When you say the above, are you saying that you don't remember what the values of MMColParam and MaxYearNum were?

I would assume that they were:
MMColParam = 2002
MaxYearNum = 2005

If this isn't what you're asking, please clarify.

Perhaps you could include the code that pieces together the SQL code you posted earlier. We could take a look at that and perhaps it would become clearer what the problem is.

-=casey=-

smoove

11:47 pm on Jan 5, 2005 (gmt 0)

10+ Year Member



I would assume that they were:
MMColParam = 2002
MaxYearNum = 2005

That is right, how did you know that. If it is that obvious then that should have been all I had to change, I would think.
I will clarify my last post. When I try to input a variable it has three entries: "name", "default value", and "run-time value". I don't remember the run-time value.

smoove

5:58 pm on Jan 6, 2005 (gmt 0)

10+ Year Member



If you can tell me where to find the other code that you need to see, I will post it. Thanks.