Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Form, loading field with session variable 1

Status
Not open for further replies.

puterdude

Technical User
Apr 13, 2001
51
US
Hi,
I would like to load a field with a session variable on a form that updates a record.
I have the field on the form as an input field.
<%RS_update.field(&quot;QID&quot;) = Session(&quot;Sqid&quot;)%>
I am not sure where to put this or if it will work. When I try it I get an error message. RS_update is my recordset. Qid the field I want to store the session varialbe in.
I also don't want to have the user be able to change this field, so it may have to be hidden, but I'm not sure.

Suggestions?

Thanks,

Puterdude
 
Thanks for helping.

Error '800a01b6'
Object doesn't support this propperty or method: 'field'

puterdude
 
I assume that you have a table which has a field named &quot;QID&quot; and you read into RS_update.
Then use
<%RS_update(&quot;QID&quot;) = Session(&quot;Sqid&quot;)%>
instead of
<%RS_update.field(&quot;QID&quot;) = Session(&quot;Sqid&quot;)%>
 
It's .fields, not field.
So,

Code:
<%RS_update.fields(&quot;QID&quot;) = Session(&quot;Sqid&quot;)%>

should work.

Jordi Reineman
 
If you want to get technical about it (and you just might want to in the near future because I read something about the next version of VB or VBScript or something that indicated that you would no longer be able to rely on default properties), the full statement would be:

RS_update.fields.item(&quot;QID&quot;).value = Session(&quot;Sqid&quot;)

Either way, you can't simply assign a value to a record set field like this and expect it to update the database. So though what all is said above is dealing with syntax, the statement won't do what the author wants it to do anyway. In fact, I believe it will give another error once the syntax is right!
 
It worked. Don't ask me why but with the syntax as they mentioned it, it works.

Thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top