ORIGINAL SOURCE CODE FOR JOIN.FRM

Made on Tuesday, Apr 8, 2003 at 9:43 AM

http://www.resourcemining.com

JOIN.FRM contained 12 resource strings and 3 non-user interface strings.

Option Explicit
'>>>>>>>>>>>>>>>>>>>>>>>>
'ResMe Converted To A Property: Const FORMCAPTION = "Join Tables"
'ResMe Converted To A Property: Const Label1 = "Select Table Pair:"
'ResMe Converted To A Property: Const Label2 = "Select Fields to Join on:"
'ResMe Converted To A Property: Const BUTTON1 = "&Add Join to Query"
'ResMe Converted To A Property: Const BUTTON2 = "C&lear All Joins"
'ResMe Converted To A Property: Const BUTTON3 = "&Close"
'>>>>>>>>>>>>>>>>>>>>>>>>


Dim mtblTable1 As String
Dim mtblTable2 As String

Private Sub cmdAddJoin_Click()
  Dim i As Integer

  frmQuery.lstJoinFields.AddItem AddBrackets(mtblTable1) & "." & AddBrackets(lstFields1) & "=" & AddBrackets(mtblTable2) & "." & AddBrackets(lstFields2)

  For i = 0 To lstTables.ListCount - 1
    lstTables.Selected(i) = False
  Next
End Sub


Private Sub lstFields1_Click()
  cmdAddJoin.Enabled = Len(lstFields2.Text) > 0
End Sub

Private Sub lstFields2_Click()
  cmdAddJoin.Enabled = Len(lstFields1.Text) > 0
End Sub

Private Sub cmdClearJoins_Click()
  frmQuery.lstJoinFields.Clear
End Sub

Private Sub cmdClose_Click()
  Unload Me
End Sub

Private Sub lstTables_Click()
  Dim i As Integer
  Dim tblTableDefObj As TableDef
  Dim fld As Field

  mtblTable1 = vbNullString
  mtblTable2 = vbNullString

  For i = 0 To lstTables.ListCount - 1
    If lstTables.Selected(i) Then
      If Len(mtblTable1) = 0 Then
        mtblTable1 = lstTables.List(i)
      Else
        mtblTable2 = lstTables.List(i)
        Exit For
      End If
    End If
  Next
  
  If Len(mtblTable2) = 0 Then Exit Sub   'only one table selected

  Set tblTableDefObj = gdbCurrentDB.TableDefs(mtblTable1)
  ListItemNames tblTableDefObj.Fields, lstFields1, True

  Set tblTableDefObj = gdbCurrentDB.TableDefs(mtblTable2)
  ListItemNames tblTableDefObj.Fields, lstFields2, True

End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
  If KeyCode = vbKeyF1 And Shift = 0 Then
    DisplayTopic 2016131
  End If
End Sub

Private Sub Form_Load()
    'ResMe autogenerated line of code to call the initialization routine that was automatically generated.
    Call frmJoin_Auto_Init
  Dim i As Integer

  Me.Caption = FORMCAPTION
  lblLabels(0).Caption = Label1
  lblLabels(1).Caption = Label2
  cmdAddJoin.Caption = BUTTON1
  cmdClearJoins.Caption = BUTTON2
  cmdClose.Caption = BUTTON3

  For i = 0 To frmQuery.lstTables.ListCount - 1
    If frmQuery.lstTables.Selected(i) Then
      lstTables.AddItem frmQuery.lstTables.List(i)
    End If
  Next
  Me.Top = frmMDI.Top + frmQuery.Top + frmQuery.txtCriteria.Top + 1300
  Me.Left = frmQuery.Left + 1500
  
End Sub


'*********************************************************************************
'**          This Section Of Code Was Automatically Generated By ResMe          **
'**                                                                             **
'** String assignments to Constants have been converted to read-only properties **
'*********************************************************************************


'This was: Const FORMCAPTION = "Join Tables"
Property Get FORMCAPTION As String
    FORMCAPTION = "Join Tables"
End Property

'This was: Const Label1 = "Select Table Pair:"
Property Get Label1 As String
    Label1 = "Select Table Pair:"
End Property

'This was: Const Label2 = "Select Fields to Join on:"
Property Get Label2 As String
    Label2 = "Select Fields to Join on:"
End Property

'This was: Const BUTTON1 = "&Add Join to Query"
Property Get BUTTON1 As String
    BUTTON1 = "&Add Join to Query"
End Property

'This was: Const BUTTON2 = "C&lear All Joins"
Property Get BUTTON2 As String
    BUTTON2 = "C&lear All Joins"
End Property

'This was: Const BUTTON3 = "&Close"
Property Get BUTTON3 As String
    BUTTON3 = "&Close"
End Property


Private Sub frmJoin_Auto_Init()
'This routine initializes all User Interface control properties on frmJoin.
'This section of code was automatically generated by the ResMe String Extraction Utility.
    Me.Caption = "Join"
    cmdClearJoins.Caption = "C&lear All Joins"
    cmdClose.Caption = "&Close"
    cmdAddJoin.Caption = "&Add Join to Query"
    lblLabels(1).Caption = "Select Fields to Join on: "
    lblLabels(0).Caption = "Select Table Pair: "
End Sub