I want to use temporary information from an unbound textbox, but i cant seem to run any code on an unbound textbox. Is this possible. I have it working with a bound "control" but cant seem to make it work with an unbound control.
Event procedure on 'unbound' textbox
Collapse
X
-
Tags: None
-
Hi, and Welcome to Bytes.
You don't really provide us with much information here. Unbound controls can be accessed like any other and their contents can indeed be processed in code. But the values of unbound controls cannot be stored (as they are not bound to any underlying fields) so they are inherently volatile.
Unbound controls on a continuous form (or a datasheet view) also behave differently to bound controls, as the value of the control is not tied to each record. The set of controls displayed in a continuous form or datasheet view is really just one set, repeated on-screen for as many record rows as the screen can display. Unbound controls shown in such lists remain at whatever value they were last set to, showing on-screen as repeating the same contents for the whole list. Accessing the value of the unbound control in such circumstances is likely to yield disappointing results.
-StewartComment
-
Thanks for such fast responses. Here is what i have.
When i try to build an event for the unbound box, it doesnt automatically start the sub for me. So what i did was used the name of the unbound field (text35) in the line for the code so the code starts like this
Private Sub text35_afterUpd ate()
when i open the form i get this error
the LinkMasterField s property setting has produced this error:"Ambiguou s name detected: text35_afterupd ate'
I dont want the information to be bound to a field because i dont want the data stored, I appreciate any help that you can provide.Comment
-
"Ambiguous name detected: text35_afterupd ate" usually means that you have two subs with this same name, which isn't allowed! Check your code to see if this is true.
Linq ;0)>Comment
-
-
It's not a problem, just try to be a little more clearer on what you are requesting. For starters:Originally posted by crazyhousethanks, sorry for the problems
What exactly do you mean by this statement?When i try to build an event for the unbound box, it doesnt automatically start the sub for me.Comment
-
The fact that the A in AfterUpdate isn't capitalized, your statementCode:Private Sub text35_afterUpdate()
and the fact that you apparently had more than one copy of this sub (hence the "ambiguous" error) makes me think that you are entering your code "freehand" which is to say typing all of the code, rather than selecting the control, going to Properties - Events, clicking on the desired event and going into the code window thru this route. If you're entering code without going thru this routine, it would explain a lot of your problems.When i try to build an event for the unbound box, it doesn't automatically start the sub for me.
Linq ;0)>Comment
-
When i stated 'sorry for the problems' it was because i did have more than 1 event for the name. Once i got rid of the extra entries the code ran fine.Comment
Comment