Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


from txtbox to a grid

from txtbox to a grid

from txtbox to a grid

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

RE: from txtbox to a grid

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,

"Everything should be made as simple as possible, and no simpler."hammer

RE: from txtbox to a grid

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.

RE: from txtbox to a grid

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.


Keep Smileing

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.

RE: from txtbox to a grid

thanks guys very interesting suggestions, i will try to both thanks so much as always

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close