View Full Version : Referencing an unbound text box


AnnaBooBoo
06-19-2001, 03:51 PM
If users enter information into an unbound textbox, and I store the information in two different places, how do I refer to the unbound text box to display the information. Once again, I'll use my agency/program example (yes, I'm still beating that dead horse!) They enter 1111/2222. The first value is agency, 2nd value is program. If I store them separately so that I can manipulate them separately, how do I bring the data back? The text box they use to input the data is unbound. My basic problem is, access keeps telling me that an Object is required. I just want to kick it. I don't want to add yet another field to my table, which would be the whole value stored just like it is entered. I will if I need to, though. I'm considering bringing the data back in separate fields, Agency and Program. I guess I just wanted to display it how they see/know it, which is 1111/2222. Thanks everyone. You guys rock.

sbornstein1
06-19-2001, 05:39 PM
I am not quite sure I understand exactly what your trying to do. If you have an unbound text box that you are filling data to you just reference that in VBA code in the Form_Load(). For example lets say you want to fill something with a sql statement.

sql = "Select Deadhorse from tblHorses"
rs.open gconn,strsql

The unbound text box if the name was TextBox1.Value You would say in code.
TextBox1.Value = rs("deadhorse")

If you want to fill another textbox with something from another unbound the same applies.
TextBox2.Value = TextBox1.Value