SQL Help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Coolboy55
    New Member
    • Jul 2007
    • 67

    SQL Help

    I have two tables: Models and Parts. Models has fields PartName and ModelID. Parts has fields PartID and ModelID. I want to select the PartID from the Parts table and the PartName for that part from the Models table, linked by the ModelID. I want to show the complete list of parts, but essentially get the name of the part from a related table instead of the Parts table. Can anyone give me a hand with the syntax? :/

    Thanks!

    CB55
  • Coolboy55
    New Member
    • Jul 2007
    • 67

    #2
    Originally posted by Coolboy55
    I have two tables: Models and Parts. Models has fields PartName and ModelID. Parts has fields PartID and ModelID. I want to select the PartID from the Parts table and the PartName for that part from the Models table, linked by the ModelID. I want to show the complete list of parts, but essentially get the name of the part from a related table instead of the Parts table. Can anyone give me a hand with the syntax? :/

    Thanks!

    CB55
    I've run into the same problem a second time... I have another case where I want to populate a field on a form, not with a field from the RecordSource, but with a field from a table related to the RecordSource table. I have a StationID field in my Tasks table which is bound by the Autonumber StationID primary key of the Stations table, but I query several columns so as to display the StationName in that field, although it is not bound by the StationName. How do I access those other columns (e.g. StationName) on my Tasks form?

    Can anyone help me out? :'(

    CB55

    Comment

    • dbpros
      New Member
      • Mar 2008
      • 15

      #3
      You can display a Name field, but internally use the ID to store within the database. Try setting the column count property to 2 on the drop down list, but bind to the first column (the ID).

      Comment

      Working...