Forms

access Nepal
  • 13 years ago

    hi all,

    I have made an access database which has 2 tables namely order and order_details which have one to may relation (order_no-->order_no).
    I want to create a form where order_no from order table are populated in combobox. Upon selecting one order number from the combobox, I want to display sum of prices in corresponing records in order_details table.

    How?? I have tried this with 
    UNDER _click event of combobox
     text1.controlsource=SELECT SUM(price) FROM order_details WHERE order_no='"& combo1.text &"'

    text1.requery

    But this did not work. when i click on combobox , '#Name?' is displayed

    Thanks in advance

  • 13 years ago

    Hi,

    Try:

    text1.rowsource = "SELECT SUM(price) FROM order_details WHERE order_no = " & combo1.text

    Thanks

    Andi

  • 13 years ago
    andimatthewsmr2 wrote:

    Hi,

    Try:

    text1.rowsource = "SELECT SUM(price) FROM order_details WHERE order_no = " & combo1.text

    Thanks

    Andi

     

    Apologies: you need to add & ";" to the end...

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“An expert is a man who has made all the mistakes that can be made in a very narrow field” - Niels Bohr