home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmReplaceMode
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "Replace Mode"
- ClientHeight = 3870
- ClientLeft = 2430
- ClientTop = 2145
- ClientWidth = 4920
- ControlBox = 0 'False
- Height = 4275
- Left = 2370
- LinkTopic = "Form3"
- ScaleHeight = 3870
- ScaleWidth = 4920
- Top = 1800
- Width = 5040
- Begin CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "&Cancel"
- Height = 495
- Left = 2640
- TabIndex = 10
- Top = 3240
- Width = 855
- End
- Begin CommandButton cmdHelp
- Caption = "&Help"
- Height = 495
- Left = 1440
- TabIndex = 9
- Top = 3240
- Width = 855
- End
- Begin CommandButton cmdOK
- Caption = "&OK"
- Default = -1 'True
- Height = 495
- Left = 3840
- TabIndex = 8
- Top = 3240
- Width = 855
- End
- Begin OptionButton optReplaceMode
- BackColor = &H00C0C0C0&
- Caption = "&0 [[Delete old db, recreate db && table]]"
- Height = 255
- Index = 0
- Left = 240
- TabIndex = 0
- Top = 480
- Width = 4575
- End
- Begin OptionButton optReplaceMode
- BackColor = &H00C0C0C0&
- Caption = "&1 [[Keep old db; recreate entire table]]"
- Height = 255
- Index = 1
- Left = 240
- TabIndex = 1
- Top = 840
- Width = 4575
- End
- Begin OptionButton optReplaceMode
- BackColor = &H00C0C0C0&
- Caption = "&3 [[Mass delete && add]]"
- Height = 255
- Index = 3
- Left = 240
- TabIndex = 3
- Top = 2040
- Width = 4575
- End
- Begin OptionButton optReplaceMode
- BackColor = &H00C0C0C0&
- Caption = "&4 [[Individual replace; if nomatch: add]]"
- Height = 255
- Index = 4
- Left = 240
- TabIndex = 4
- Top = 2400
- Width = 4575
- End
- Begin OptionButton optReplaceMode
- BackColor = &H00C0C0C0&
- Caption = "&2 [[Keep old db; add new records to table]]"
- Height = 255
- Index = 2
- Left = 240
- TabIndex = 2
- Top = 1680
- Width = 4575
- End
- Begin OptionButton optReplaceMode
- BackColor = &H00C0C0C0&
- Caption = "&5 [[Field update; if nomatch: log error]]"
- Height = 255
- Index = 5
- Left = 240
- TabIndex = 6
- Top = 2760
- Width = 4575
- End
- Begin Label Label1
- BackColor = &H00C0C0C0&
- Caption = "DON'T retain old records:"
- FontBold = -1 'True
- FontItalic = -1 'True
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 120
- Width = 3495
- End
- Begin Label Label2
- BackColor = &H00C0C0C0&
- Caption = "DO retain old records:"
- FontBold = -1 'True
- FontItalic = -1 'True
- FontName = "MS Sans Serif"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H000000FF&
- Height = 255
- Left = 120
- TabIndex = 5
- Top = 1320
- Width = 3135
- End
- Option Explicit
- Dim modeSelected 'save from radio click event
- Sub cmdCancel_Click ()
- Unload Me
- End Sub
- Sub cmdHelp_Click ()
- Dim Msg
- Msg = Msg & "MODE 0 will delete an entire existing MDB file, and all its "
- Msg = Msg & "Tables. The records are added to a new empty table in the db." & NL & NL
- Msg = Msg & "MODE 1 will keep the existing MDB file, and all its " & NL
- Msg = Msg & "Tables, except the destination table. This table is" & NL
- Msg = Msg & "entirely replaced by the new records." & NL & NL
- Msg = Msg & "MODE 2 retains the database file, and all tables and all" & NL
- Msg = Msg & "records in those tables. It ADDS records to the existing" & NL
- Msg = Msg & "destination table."
- MsgBox Msg
- Msg = "MODE 3: You can delete all records with some attribute " & NL
- Msg = Msg & "from a table, and replace them with new ones. " & NL
- Msg = Msg & "- Build your function Mode345Key to return the number" & NL
- Msg = Msg & " of the field (in the array gIOFld) " & NL
- Msg = Msg & "- you get a chance to abort, showing the record count " & NL
- Msg = Msg & "- if ok, SQL delete is used to delete the records " & NL
- Msg = Msg & "- then all new records are added to the table. " & NL
- Msg = Msg & "- NOTE: all records that get through PassFilter MUST" & NL
- Msg = Msg & " have the same attribute in this field, since only" & NL
- Msg = Msg & " the first one is checked!" & NL
- Msg = Msg & "- no index is required since SQL is used to deal with" & NL
- Msg = Msg & " the replaced records."
- MsgBox Msg
- Msg = "MODE 4 & 5: These are for updating UNIQUELY INDEXED records in " & NL
- Msg = Msg & "the destination table. " & NL & NL
- Msg = Msg & "You must also complete the Functions Mode345Key and Mode45Key " & NL
- Msg = Msg & "in your code module. " & NL
- Msg = Msg & "- Mode345Key returns the field number in the gIOFld array" & NL
- Msg = Msg & "- Mode45Key returns index name in the destination table. " & NL & NL
- MsgBox Msg
- Msg = "MODE 4: If NOMATCH is found to the index, the record is added to " & NL
- Msg = Msg & "the file. You can use this when you may be replacing an entire " & NL
- Msg = Msg & "record, or adding an entire new record. " & NL & NL
- Msg = Msg & "MODE 5: If NOMATCH is found to the index, the record is logged in " & NL
- Msg = Msg & "the run log file. You can use this when you are updating specific " & NL
- Msg = Msg & "fields of existing unique records, and you want to be notified if a " & NL
- Msg = Msg & "record does not exist. Only the fields you are updating should be in " & NL
- Msg = Msg & "the array gIOFld. " & NL
- MsgBox Msg
- End Sub
- Sub cmdOK_Click ()
- Form1!lblReplaceMode = ReplaceModes(modeSelected)
- ReplaceMode = modeSelected
- Unload Me
- End Sub
- Sub Form_Load ()
- Dim i
- optReplaceMode(ReplaceMode).Value = True
- For i = 0 To UBound(ReplaceModes)
- optReplaceMode(i).Caption = ReplaceModes(i)
- Next
- End Sub
- Sub optReplaceMode_Click (Index As Integer)
- If ProgramEdit = True Then
- ProgramEdit = False
- Exit Sub
- End If
- modeSelected = Index
- End Sub
-