Skip to main content
Participant
August 22, 2006
Question

Default value for a recordset

  • August 22, 2006
  • 1 reply
  • 305 views
I have a recordset that is determined by the results for a drop list. However, I would like for the recordset to first default to the value stored in the users table.

I set the drop list field to default to the users table defaultLang field but it only changes the field and not the recordset that is fed by the field.

USERS.DefaultLang

The List field is Lang

I currently have it set to
Select *
From StandardFields
Where MMColParam = LanguageID

MMColParam Request.Form("Lang")
This topic has been closed for replies.

1 reply

Inspiring
August 22, 2006
Im not sure I totaly follow your problem,

But i would query the database initially using a session var or defaults as you are doing if the users preferences were set, if they were set then id set the session Var to something out of their preferences and pull a recordset based on that, Or I would try and do it with a cookie and query from what it held about the user.

If your user has to sign up to join your database I would ask for the info in the application form so when it gets added you have the data to query with before they log in..

Hope thats on the right lines of your problem..
Regards
Tag
JODYL1810Author
Participant
August 22, 2006
MY problem is that I want the recordset to default to the users preference, but also be allowed to be changed from the default value using a list drop list.

I have the user set a default language when establishing an account.

When the user opens a page it uses that language (spanish, engligh etc). I have a drop list of languages at the top of the page and would like for the same recordset that used the users preference to change to the selected language when the user uses the drop list.
Inspiring
August 23, 2006
Hi

What I would do there is, On the page opening I would do it with a session Var pulling a recordset, if the session var has no value then assign a default..

VB:
<%
Session("GetLanguage") =request.Form("lstlanguage")
if Session("GetLanguage") ="" then
Session("GetLanguage") ="English" ' or set to the users default in their preference
end if
%>


Then when the user uses your drop down list you have the options set the values to your session var on your recordset then submit the form with the listbox's on change something like

Set your forms action to the current page and it will reload for you.
VB:
onChange="this.form.submit();"

the recordset will take the new data from the session Var and it will pull your new data for you.
HTH