Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 653247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:21:39+00:00 2026-05-13T22:21:39+00:00

Relevant Tables #One# +———-+ +————–+ |Quotations| —> |PurchaseOrders| +———-+ | +————–+ <One> | <Many>

  • 0

Relevant Tables

                                  #One#
+----------+         +--------------+
|Quotations|  --->   |PurchaseOrders|
+----------+    |    +--------------+
         <One>  |  <Many>           |
                |                   v  #Many#
                |    +-----------+        +------------+ 
                v    |QuotedItems|  --->  |OrderedItems|
                     +-----------+        +------------+
                   <Many>      {One}    {Many}

Form/Subform

PurchaseOrders – Master Form, many-to-one with OrderedItems
OrderedItems – Datasheet-style subform, many-to-one with PurchaseOrders

Quotations– A table that is one-to-many with PurchaseOrders and used for querying
QuotedItems – A table that is one-to-many with OrderedItems and used for querying


Combo Box

The Item control resides in the OrderedItems subform. It is a combo box that runs the following ad hoc query:

SELECT [ID], [Code]
FROM   [QuotedItems]
WHERE  [QuotedItems].[Quotation] = Forms.PurchaseOrders.Quotation;

The combo box query runs the way I expect it to; there are no problems here. The [ID] column is hidden from view (column-width is zero).


Problem

The problem comes when I try to append values from the QuotedItems table (filtered on the current quotation ID selected in the form) at the click of a button.

I created an append query to achieve this called CopyQuotedItems2OrderedItems:

INSERT INTO OrderedItems ( PurchaseOrder, Item, Quantity )
SELECT PurchaseOrders.ID, QuotedItems.Item, QuotedItems.Quantity
FROM (    Quotations
          INNER JOIN
          PurchaseOrders
          ON Quotations.ID = PurchaseOrders.Quotation
     )

     INNER JOIN

     QuotedItems

     ON Quotations.ID = QuotedItems.Quotation  

WHERE (((Quotations.ID)=[Forms].[PurchaseOrders].[Quotation]));

The Copy Quoted Items button in the PurchaseOrders form then runs the following code:

Private Sub CopyQuotedItems_Click()
    DoCmd.OpenQuery "CopyQuotedItems2OrderedItems"
End Sub

The append works as it should. However, the second field of the INSERT statement – which ties in to the Item control does not display anything, even after refreshing. The only way to make the item’s Code visible is to select the combo box and choose an item from it.


1000 words…

Before clicking Copy Quoted Items (note that combo box has two entries in this case):

alt text http://img251.imageshack.us/img251/9529/beforeappendwithcombo.png

After Clicking Copy Quoted Items:

alt text http://img651.imageshack.us/img651/8175/afterappendclick.png

Questions

  • Firstly, why can’t I see my Code by default after running the append query? Is it because the value inserted by the append query is not bound to the combo box in some way?
  • Secondly, am I barking up the wrong tree? If so, how else can I get it to display
    the Code column automatically?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:21:40+00:00Added an answer on May 13, 2026 at 10:21 pm

    I am not sure I get you, but have you tried a Requery rather than a refresh?

     <Me or form/subform name>.CodeCombo.Requery
    

    It may be necessary to requery the form or subform, but I do not think so.

    EDIT re Further Information

    The problem here is that you are using look-up fields in tables. This is an anti-feature and will, IMHO, continue to make your life difficult. Because of this, you are not updating the item field with an item code but an item id: 2 rather than 30105-250G. Furthermore, 30105-250G is a value made up of parts. There are several approaches to fixing this, the easiest is probably to match up the model id again and extract the code field. However, I strongly recommend that you get rid of all look-up fields and work with relational design ideas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 324k
  • Answers 324k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Make sure that all externs are correctly defined. The CLR… May 14, 2026 at 1:15 am
  • Editorial Team
    Editorial Team added an answer Have you looked at the Zend_Currency family of functions? This… May 14, 2026 at 1:15 am
  • Editorial Team
    Editorial Team added an answer The question has been answered on http://social.msdn.microsoft.com/Forums/en/clr/thread/93efa20f-5423-4d55-aa3d-dadcc462d999. Basically, it is… May 14, 2026 at 1:15 am

Related Questions

I have a class I'm unit testing that requires fairly extensive database setup before
I have an insert that uses a condition checking for a NOT IN. There
I have a table which has no primary key and I can't add one
I have a table with the following columns in table: id, t1, t2, t3,
How do I sort a MySQL table by two columns? What I want are

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.