Re: Form Editing Question
http://www.vbforums.com/attachment.p...id=47243&stc=1
I've moved your thread here which is the place to ask VBA questions.
Re: Form Editing Question
to set the focus to a specific textbox you can either in design mode set the tabstop proerty to 0
or in the form initialise event use txtqcom.activate
if you want the code you posted to take effect as soon as you load the form, try the form initialise event
you should avoid, if possible, reference to activecell, but provide the full address to the cell
setting th maxlength of textbox only stops the user entering more characters. but does not limit length of text entered by code, you would need to cut the string like
txtQtype.Text = left(Qtype, instr(qtype, "(") - 1)
and to get txt inside parenthesis
Code:
pos = instr(somestring, "(")
txtQest.text = mid(somestring ,pos +1, instr(pos +1, somestring, ")") - pos -1)
of course in either example i the string does not contain the parenthesis then an error would occur
Quote:
Also I'd like to know how to make pressing the Enter button when in a textbox function the same as clicking OK.
check out the enterkeybehvior property of the text box or the default property of the OK button