Jump to content

Trouble selecting value from DBLookupComboBox

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
georgiegal

georgiegal

    Newbie

  • Members
  • Pip
  • 2 posts
Hi guys,

I was hoping somebody could kindly shed some light on a relatively basic function for I am trying to execute in Delphi for a project I am completing for work. I am very new to the world of Delphi so any assistance would be greatly appreciated.

I have connected a MS Access Database to some DBLookupComboBoxes. A one to many relationship exists whereby a user selects a particular material from a dropdown menu, but for each material, there may be more than one colour that the user can select, all of which price may differ.

Currently, if a user selects a particular material, all the colours within the database display, irrespective of material chosen. In addition, depending on the material that is selected, all the colours are highlighted by the pointer for when the user attempts to chose a colour.

I eagerly anticipate any reponse from the professionals!! :)

Regards,

Georgiegal

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
You probably need to have a query that you run when you change the material so the list of colours will be limited to that material.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
georgiegal

georgiegal

    Newbie

  • Members
  • Pip
  • 2 posts
Hi WingedPanther,

Thank you so very much for that.

I am not very proficient with queries so I your assistance would be greatly appreciated.

I currently have 2 tables.

1. Raw Materials
Fields: MatSpec, MatGrade, MatName
2. Colour
Fields: Colour, RawMatSpec, Price

I have established a 1 to many relationship between MatSpec in the Raw Material Table and RawMatSpec in the Colour Table.

Are you able to guide me in the creation of the query given this info?

Thank you so much!!