Results 1 to 2 of 2

Thread: linking 2 tables 2 fields (dbase newbie)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    linking 2 tables 2 fields (dbase newbie)

    i have 2 tables , GUAGES and GUAGE RECORDS. The Common Key on Both Tables is 'guage number'.

    I also have 2 forms.. The first form displays the guage data for each guage, and the second form displays the

    guage calibration records for each individual guage.

    The 'guage number' field (Primary key) is in form1.text1.text. So to view the corresponding guage record

    calibration data from the Guage Records table i use the following SQL

    Dim strSQL As String

    strSQL = "Select * From GuageRecords Where [Guage number] = " & "'" & Form1.Text1.Text & "'"

    Data1.Recordsource = strSQL
    Data1.Refresh
    Data1.UpdateControls

    The problem is that i have created another 2 tables, again both have the guage number field, They both have a

    Calibration Number field aswell.

    What would be the Equivalent SQL statement to enable me to view records that have both the same Guage AND

    Calibration Numbers.

    Indeed many Guages have the same calibration numbers, so i need the guage number to view the calibration number

    for the specific guage.

    Any help would be greatly appreciated.

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313
    Something like this you mean?

    VB Code:
    1. strSQL = "Select * From GuageRecords Where [Guage number] = '" & Form1.Text1.Text & "' AND [Calibration number] = '" & Form1.Text2.Text & "'"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width