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!

from txtbox to a grid

Status
Not open for further replies.
Jan 20, 2007
237
US
Hi all,
i am typing a value in a txtbox, then once i pressed enter, this value, will go into a column grid, well actually will be in the text1 and of course the value get saved in a cursor, then i need, once the value gets displayed in the grid, to setfocus to the txtbox w/o user intervention as i need to continue typing values there and passing them to the grid, i am not able to setfocus back auto to the txtbox once the value is in the grid, unless i use the mouse cursor and position it in the txtbox, can you please advise how can i do this ?
Thanks a lot
 
Can you show us the code you're using?
What is the record source of your grid?
What is the control source for your text box?


Best Regards,
Scott
MIET, MASHRAE, CDCP, CDCS, CDCE, CTDC, CTIA, ATS

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Return 0 from the textbox valid to stay. The problem is, when do you want to exit?

You could let the user enter 0 as final value and don't transfer 0 to the grid column. But then also a mouseclick elsewhere after you typed the last value would re-enter that value into the grid. And you don't want to deep dive into more trouble now, finding ways to detect whether the user leaves the textbox with mouseclick.

So the better solution to that is a textbox and a button. the button is there to transfer the textbox value to the grid (via insert into the grid cursor). You can enter values by keyboard only with double ENTER key, and the click event of that button could do grid.refresh() and text1.setfocus() to get into that entry loop, but the user can easily tab out without clicking the button or leave with a mouse click anywhere.

Bye, Olaf.
 
I don't suppose you would be interested in a combination that could create pretty quick data entry and look a bit different?

If you swapped your textbox for a multi-line fixed width editbox, with a button as Olaf suggests, the user could type in 10 or so values, using a {enter} at the end of each one, then the button could be used to add the entries to the grid by breaking them down into non-blank lines - then clear the editbox and return focus there.



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
thanks guys very interesting suggestions, i will try to both thanks so much as always
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top