Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2003, 12:58 PM
Registered User
 
Join Date: Jun 2003
Location: x, y, United Kingdom.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ywith Send a message via MSN to ywith
Default some questions - hope someone can help

I've got a couple of questions to ask for a project i'm doing for school, i hope someone can help.

1. I'm creating a inventory system, and like stock re-ordering. I've got a table with a list of products and this information is shown in a form. I have a product form with a record for each product you can have. I want to be able to click a button and the product number (autonumber for the product and the primary key) is selected in another table ready for making a re-order. So basically say i was on the record for bannanas, i would then click a button, and the form for purchasing would pop up and in the drop down box for the product i want to purchase i would like bannanas selected. So i want the value of the drop down box to be the same as the record i was viewing. Is there any way to do this in a macro.

2. How is it possible in a drop down box to have two fields shown next to each other. Because i got like a drop down box, which is the primary key, but all that is is (1,2,3,4,5...) rather than like (apples, bannanas, oranges....etc). So could i like select the bannnas word, and then it update a text box or sumthing with the relevant product number?

3. I want to have a table with the amount of each product in stock. Would it be possible to have a form where i type in a amount to be re-odered, and that field be updated by adding the value i've just entered to the current value so basically adding the new products to the current amount of products in stock.

I'd be very appreciative if you could help.

any other suggestions would be welcomed too.
 :)
Reply With Quote
  #2 (permalink)  
Old June 12th, 2003, 01:27 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

1. The best way to handle this problem would be to write a sub that would trigger the ordering form to open and set the value of your given combo box to the product from the first form:

Code:
Private Sub cmdOrderButton_Click()

    DoCmd.OpenForm "frmProductOrder", acNormal, , "productName='" & txtProduct & "'"
    Forms!frmProductOrder.cmbProductName.Value = "Bananas"

End Sub
Where frmProductOrder is the product order form and cmbProductName is the name of your combo box or drop down list.

2. Set the RowSource property for your combo box using an SQL statement:

Code:
RowSource = "SELECT tblProductInfo.productID, tblProductInfo.productName FROM tblProductInfo;
Where tblProductInfo is the table that contains the product information.

3. The best way to do this would be to use Recordset to update the table that contains the quantities that are in stock. But it might be easier to have both forms open and have the reorder form update the value in stock form if you are not familiar with Recordsets.

Hope that helps!


[edit] Typos

-Shay Shepston
Reply With Quote
  #3 (permalink)  
Old June 12th, 2003, 11:42 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

For Shay's suggestion in 2. to work, you'll also have to remember to set the Column Count to 2 - I assume Shay took it for granted - but just thought I'd point this out :)

Steven

There are 10 kinds of people in the world - those who understand binary - and those with friends
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hi hope someone can help here!!! mike_remember ASP.NET 1.0 and 1.1 Professional 2 October 31st, 2006 09:14 AM
Hope to have a idea for designing this system nadee VB Databases Basics 3 February 24th, 2006 03:24 AM
I hope it could help for right-click Yahoa Javascript How-To 0 December 11th, 2005 02:58 PM
Boy I sure hope the code is better hesterloli Wrox Book Feedback 3 February 10th, 2004 10:56 AM
Hope if any one can provide some help RahilPatwa All Other Wrox Books 0 November 8th, 2003 01:31 AM



All times are GMT -4. The time now is 12:26 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.