Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2012, 12:48 AM
scarymovie scarymovie is offline Display result in textbox based on the input of another textbox Windows 7 64bit Display result in textbox based on the input of another textbox Office 2010 64bit
Novice
Display result in textbox based on the input of another textbox
 
Join Date: May 2012
Posts: 3
scarymovie is on a distinguished road
Default Display result in textbox based on the input of another textbox

Hi all, I am very new to VB.

I need to create a form in Word 2010, which requires a user to fill in the price of an item (similar to a purchase order). There are 2 text boxes, one which user enters the price of that item, whereas the other box displays an indicator depending on the price range user keys in. For instance, if user entered Price>1000, the indicator text box needs to show "A". If Price<700, then it shows "B", and Price<300, the display will be "C".



I hope someone could help me with this. Please be concise. Thank you guys.
Reply With Quote
  #2  
Old 05-16-2012, 01:12 AM
macropod's Avatar
macropod macropod is offline Display result in textbox based on the input of another textbox Windows 7 64bit Display result in textbox based on the input of another textbox Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Do you mean something like the attached?
Attached Files
File Type: doc FormDemo.doc (34.0 KB, 33 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 05-16-2012, 02:18 AM
scarymovie scarymovie is offline Display result in textbox based on the input of another textbox Windows 7 64bit Display result in textbox based on the input of another textbox Office 2010 64bit
Novice
Display result in textbox based on the input of another textbox
 
Join Date: May 2012
Posts: 3
scarymovie is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Do you mean something like the attached?
Hi macropod, thank you for your reply.

Unfortunately no. The document you provided merely allows me to type something. What I need is when you type something in a text box, an indicator will show in another text box depending on what you've keyed in (conditions).
Reply With Quote
  #4  
Old 05-16-2012, 02:22 AM
macropod's Avatar
macropod macropod is offline Display result in textbox based on the input of another textbox Windows 7 64bit Display result in textbox based on the input of another textbox Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Did you exit the formfield (eg by pressing the tab key)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 05-16-2012, 05:53 PM
scarymovie scarymovie is offline Display result in textbox based on the input of another textbox Windows 7 64bit Display result in textbox based on the input of another textbox Office 2010 64bit
Novice
Display result in textbox based on the input of another textbox
 
Join Date: May 2012
Posts: 3
scarymovie is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Did you exit the formfield (eg by pressing the tab key)?
Ah, Now I see that? How did you do it?
Reply With Quote
  #6  
Old 05-16-2012, 07:05 PM
macropod's Avatar
macropod macropod is offline Display result in textbox based on the input of another textbox Windows 7 64bit Display result in textbox based on the input of another textbox Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

To see how, click Developer > Restrict Editing > Stop Protection.

Then click on the formfield and click Developer > Properties. You'll see that the fomrfield has a bookmark name and an option 'calculate on exit' that is checked.

Then press Alt-F9 to expose the field code for the forumula field.

That's all there is to it.

Do note that, with such a document, you can only enter data in the formfields. If you want to be able to enter data elsewhere, you need to use Section breaks to differentiate the Sections that will/will not have the formfield protection. See attached.

For an idea of what can be achieved with formula field coding, check out my Microsoft Word Field Maths Tutorial, at:
http://windowssecrets.com/forums/sho...l=1#post320143
or
http://www.gmayor.com/downloads.htm#Third_party
Attached Files
File Type: doc FormDemo.doc (34.0 KB, 17 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert a hyperlink in activex textbox Joe Patrick Word VBA 1 10-03-2011 06:03 AM
textbox color issue Dave Duncan Word 0 08-07-2011 10:38 AM
Motion paths and shrinking textbox Brin PowerPoint 0 01-12-2011 10:04 AM
Textbox Template t0m46 Word 0 09-07-2010 03:38 AM
Creating Chart using VB textbox value shyler82 Word VBA 0 03-12-2010 06:56 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:51 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft