Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Please help me...word vba and database

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jennifer - 09 Jan 2006 07:17 GMT
Dear Experts,

I really stack with this very small project....I have a word document and
its form from VBA...in the form there are one combobox called "Item Code" and
two textfields called "Description" and "Qty"..and there is a button called
"OK"...the scenario is, if I select "Item Code" it will show data on the
"Description" textfield and "Qty" let it blank (which is I already found it
about the codes) ...

My question is what codes if I fill the Qty textfield with 2 (the number
integer).. and then when I press "OK"..then it will deduct 2 as well in the
Item table on Access file please???...

I would very happy if you provide me a walktrough/codes for this....

Thank you very much for your helps..

Jennifer
Cindy M  -WordMVP- - 10 Jan 2006 10:17 GMT
Hi =?Utf-8?B?SmVubmlmZXI=?=,

> I really stack with this very small project....I have a word document and
> its form from VBA...in the form there are one combobox called "Item Code" and
[quoted text clipped - 8 lines]
>  
> I would very happy if you provide me a walktrough/codes for this....

This is really a question you should ask in an Access newsgroup. Basically,
though, you'd have two approaches.

1. Use DAO or ADO (whichever you're using to pull the data from the database
into the form). Set up a recordset containing just the selected record from
"Item Code". Set the value for the "QTY" field. Very roughly
   intQty = rs.Fields("Qty").Value
   intQty = intQty - txtQty.Value
   rs.Fields("Qty").Value = intQty

2. Faster, but perhaps more complex for you to deal with, would be to run an
UPDATE query on the recordset.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.