Results 1 to 3 of 3

Thread: Subform help

  1. #1
    Join Date
    May 2004
    Posts
    2

    Unhappy Unanswered: Subform help

    I'm in the process of making an access based application for a dry cleaners. Here's my problem. I have a Main form called "CustomerOrders" and a subform in that form called "OrderDetails subform." The main form has a ton of command buttons that when clicked will put information into the subform based on which button is clicked.
    Example: User clicks the shirt button the following data is insterted into fields in the subform table

    OrderID = current OrderID on the main form
    ProductName = Shirt
    Quantity = 1
    UnitPrice = A price set in a text box in main form
    SubTotal = Quantity * UnitPrice

    So, I can get the button to add that info when I click it the first time, What I want to do is when hit the 2nd time it will find the orderdetails for shirts and update the quanitity only. I know there are other easier ways to achieve this but this is for a very user friendly approach that will be using touch screen. So again an imagebutton adds Order Info into the subform and when his a second time it has to retrieve that record and update teh quantity only. Any guidance? I've tried several methods such as FindRecord and gotorecord but I run into a lot of errors on vb side.

  2. #2
    Join Date
    Feb 2002
    Posts
    403
    Attached is a quick and dirty example of one way this could be done. I have tried to comment the code enough that you can apply it to your real situation.

    HTH

    PS: Don't take too much notice of how I have set the forms up. It will probably confuse you.
    Attached Files Attached Files

  3. #3
    Join Date
    May 2004
    Posts
    2

    Thumbs up Thanks!

    Wow,
    that works pretty well. I didn't think about using sql, I'm kind of new to Access and was just using plain vb on the forms. I've tweaked your code to match my form. Thanks so much for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •