Updating a text box as new entry

Gkirkup

Registered User.
Local time
Yesterday, 16:20
Joined
Mar 6, 2007
Messages
628
I have a form on which text is entered into a text box, which drives various subforms and queries on the form. One of the related forms (not a subform, but which pops up on a command button click) allows selection of a similar item. Having clicked on that, I copy that item text to my starting text box and close the related form, ready to start over on my main form with the new item.
That works fine. My problem is that if you press <Enter> on the text box, nothing happens. You have to delete part of the text, re-enter it, then press <Enter> to make it work.
How can I make it know that there is a new entry in the text box, when <Enter> is pressed? Even better would be to not require a key press at all, but just process the new entry as though <Enter> was pressed.

Robert
 
I'm not quite sure why you are doing this but but before you close the
pop up form from a command button, (no Enter on the text box needed), you could assign the value of the text box to the text box on the calling form and even requery any subforms at the same time.
 
Look into the onchange event.
 
H&W: It has to do with part numbers. I display all the details of a part number, and a button can pop up a 'Close part numbers' form. They can select another part number on that form, and then I return control to the main form, with all the information on the new form displayed.
A requery of the main form does the trick. However, the top subform on tabs does not display (not sure why), so I may have to requery that too.

Robert
 
How do I requery a subform on a form, when I am not on that form? I tried both of these. Neither of them seems to work. (I can requery the main form OK).

[Forms]![MyMainForm]![MySubForm].Requery
[Forms]![MyMainForm]![MySubForm].Form.Requery

Robert
 
I think that both of those should work.

What control on the main form does the subform depend on and does this change before the requery?

How about only requerying the subform on the tab when the tab is opened / displayed.
 
H&W: I found the cause of the non-requeried subforms. I do all of my subforms using a query of which the criteria is the text box on the main form. Those requeried automatically when I requeried the main form. But there were a couple of old 'inherited' subforms which use field relationships in the subform control. Those were not being requeried. I changed the queries to use criteria from my text box and all was fine.

Robert
 
That is good Robert.

One learns so much by having problems.

ZZZzzz's now as it's nearly tomorrow.
 

Users who are viewing this thread

Back
Top Bottom