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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change values in a recordset and assign it to a text box on a form

Status
Not open for further replies.

infoscion

Technical User
Jan 21, 2005
50
US
Hi All:
I have having issues with changing values ina recordset and assigning it to a text box. The error message that comes up "object required". basically the Recordset pulls up an ID as a number but before i display it on a form I want to it be more meaningful such that the number can be tied in with names of people. Please suggest some ideas.
Regards,
Info
PS.I have appended the code that does this for your reference

If rs.Fields("Name").Value = "1" Then
Set rs.Fields("Name").Value = "A, B"
End If
 
Hi,

Good news, you can dispense with the recordset code altogether. I presume that you have a table somewhere that maintains the names of these people and can provide the relationship between names and ID.

Therefore use a select query to provide the information to your form. If you need to present this data independently of the form's current recordsource, then use a subform, con=mbobox or listbox.

Cheers,
Bill
 
The Set instruction is reserved for Object instantiation.
Replace this:
Set rs.Fields("Name").Value = "A, B"
By this:
rs.Fields("Name").Value = "A, B"
rs.Update

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi PHV:
Thanks for the inputs It works now.
Regards,
Info
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top