I made a very simple vba program using word2003 with 3 texboxen for input, and some labels for calculated output ( simlpe tax caculation with variable tax % ), 1 commandbutton to start calculating, and 1 commanbutton to " reset" the whole thing( clears the 2 input textboxen, and keeps the tax % texbox).
all works well, but when i push the Reset button, all gets erased, but the setfocus won't work.
code ( when reset button is pushed) is something like:
textbox1.text = clear
...
texbox1.setfocus
end
i would also like to use the tab key to go from inputbox to inputbox, how do i achieve that ?
indeed, there is no user form involved, is that why i can't seem to get the tab key working ? I remember in VB 6.0 ( not vba ) that there was a "tab priority" to adjust, but i don't find anything like that in my Word VBA textbox properties ?
hi,
let me give you the full story so you can see what i'm trying todo.
i'm trying to convert a word file wich acts as an invoice ( for training only ) from a word file with tables, to a word file where you can input a product id number, and a number to indicate howmuch of product X the client wants, taxes and total price and productdetail will be inserted in labels when product id number and number of pieces are known.
so i started with my 2 textboxen and some cmdbuttons to do some very basic calculation just to see if it would work, and i got the impression that it would work, after i input al needed data ( some 100 products with id number and price and taxrate ( can be 6% 12% or 21% depending on the product )
my goal is to stay with the original word file, because, if i used a userform, i might as well start from scratch in vb6.
so, within my word file, everyting must work as desired ;-) incuding the "tab" function.
In Word you can have up to 3 different types of TextBoxes. All of which are different in the way to handle the tabbing order.
You can have ActiveX TextBox, Word Form Field TextBox, and UserForm TextBox controls.
So if you could attach the document or provide a small screenshot of the textboxes, its really hard to solve.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
You had the reset button set to take focus upon click. The setting was in the properties window for the reset button.
I also took out the Clear functions and replaced them with vbNullString.
Works fine now.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.