Page 4 of 5 FirstFirst 12345 LastLast
Results 46 to 60 of 73
  1. #46
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    Yeah all my forms work and if you select Book_ID the combo box opens and as im using multiple columns it displays the books title and uses that as an alias but the ID is inserted into the database (this was suggested in an earlier post), that works fine.



    But I want the book_price box to find the price of the book that is selected in Book_ID combo box.


    the record source of the form is Orders tablebut the Book_ID and Book_Price boxes are in the subform which has the record source Order_Details

    I couldnt find record source of the Book_ID combo box but it has the control source of Book_ID and the row source of:

    SELECT Books.Book_ID, Books.Title FROM Books ORDER BY Books.Title;


    And for the Book_Price combo box the row source is:

    SELECT retail_Price FROM Books WHERE Book_ID=Forms![Order_Details Subform]!Book_ID;

    This is a code I interpretted from another website but it doesn't work at all.

  2. #47
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Do you really have a combo box for Price?

    What is the name of the combobox for Book_Id?

  3. #48
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    Its only a combo box because on some other website i was reading something similar to my problem and they said to put a code in the row source but obviously a normal text box field doesnt have a row source so i tried it with the combo box. But yeah ill change it back to a normal text box if that'd work.

    The combo box for Book_ID is just 'Book_ID'

  4. #49
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Try something like
    Forms![Order_Details Subform].Form!Book_ID

    What is the recordsource of the subform?

  5. #50
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    The record source for the 'Order_Details Subform' is the 'Order_Details' table.

    And I wasn't sure where you meant for me to put the 'Forms![Order_Details Subform].Form!Book_ID' so i tried it in the Row Source of the Book_Price combo box but it returned an error saying 'The record source 'Forms![Order_Details Subform].Form!Book_ID' specified on this form or report does not exist.' But the form is called 'Order_Details Subform' and the book_id box is called Book_ID?

  6. #51
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    Should I replace the combo box with a text box?

  7. #52
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    I was thinking for you to replace
    And for the Book_Price combo box the row source is:

    SELECT retail_Price FROM Books WHERE Book_ID=Forms![Order_Details Subform]!Book_ID;

  8. #53
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    oh right okay sorry getting late here, I must be losing concentration haha thanks i'll give that a go.

  9. #54
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    Ok I tried 'SELECT retail_Price FROM Books WHERE Book_ID=Forms![Order_Details Subform].Form!Book_ID; ' In the Row Source of the Book_Price combobox but I select a book from the list using Book_ID combobox and then I click the Book_Price combobox and It asks for me to enter a parameter value.

    I just want the book_Price box to put the price from the books table for the book_ID which is provided in Book_ID combox box.

    Thanks for the help so far, anymore suggestions?

  10. #55
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    Can you post a copy of your mdb? You can remove anything confidential.
    Just a few records to show the form with data.
    Zip format is good

  11. #56
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    Ok no problem and the tables already should have 15 rows each (if they have more its because I was testing and forgot to delete them)

    And also i have plenty of images associated with the .mdb so im not sure how they will link but hopefully it'll work.


    The file is 2.1Mb and the forum limit is 2.0Mb so I uploaded it to mediafire

    http://www.mediafire.com/download.php?77anc9ah1gq23bk

  12. #57
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,959
    Did you run Compact & Repair before zipping? The project has embedded images? I can't download from that site until I get my home computer fixed.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #58
    ilikeshinythings is offline Advanced Beginner
    Windows 7 64bit Access 2003
    Join Date
    Mar 2012
    Posts
    37
    Yeah It has images in it and I didn't compact and repair, should I have? oops

  14. #59
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,742
    I looked at your forms, and was not sure of your intent. I saw continuous forms?

    I copied your database to jdatabase.mdb in the zip.

    I created 2 forms jOrders and JOrderDetails where jOrderDetails is a subform. The form subform are linked on Order_id.

    I created a lookup field Customer Name on the Order form ( It looks up a displays the Customer name for that Customer Id)

    I also altered the color and font of the Book_Id and the Price in the subform to show the 2 are linked.
    Attached Files Attached Files

  15. #60
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,959
    Compact & Repair might have made the file small enough to attach.

    Design editing causes file size to grow. Need to run C&R periodically, or set to run automatically when project closes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Page 4 of 5 FirstFirst 12345 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 03-20-2012, 11:09 PM
  2. Weather Database Ideas
    By bigroo in forum Database Design
    Replies: 4
    Last Post: 01-19-2012, 09:43 AM
  3. Ideas for database creation
    By randolphoralph in forum Access
    Replies: 1
    Last Post: 08-31-2011, 02:08 PM
  4. Any ideas?
    By eripsni in forum Access
    Replies: 9
    Last Post: 08-25-2011, 08:33 AM
  5. Piano Shop Database
    By tomself1 in forum Database Design
    Replies: 1
    Last Post: 02-19-2010, 08:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums