'in General-Declarations:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Sub Check1_Click()
Check2.Enabled = False
Text7.Enabled = True
Command8.Enabled = True
Label13.Caption = Text4.Text
Text8.Text = Label13.Caption
End Sub
Private Sub Check2_Click()
Check1.Enabled = False
Check3.Enabled = False
Check4.Enabled = False
Command2.Enabled = True
Label15.Caption = Text10.Text
Text8.Text = Label15.Caption
End Sub
Private Sub Check3_Click()
Command2.Enabled = True
Check4.Enabled = False
Label14.Caption = Text6.Text
Text9.Text = Label14.Caption
End Sub
Private Sub Check4_Click()
Command2.Enabled = True
Check3.Enabled = False
Label16.Caption = Text11.Text
Text9.Text = Label16.Caption
End Sub
Private Sub Command1_Click()
Adodc1.Recordset.AddNew
Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Command4.Enabled = False
Command1.Enabled = False
Command5.Enabled = True
Command7.Enabled = True
Check1.Enabled = True
Check2.Enabled = True
Check3.Enabled = True
Check4.Enabled = True
End Sub
Private Sub Command2_Click()
Adodc1.Recordset.Update
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Command4.Enabled = True
Command1.Enabled = False
Command2.Enabled = False
Command6.Enabled = True
Command5.Enabled = False
Command7.Enabled = False
Check1.Enabled = False
Check2.Enabled = False
Check3.Enabled = False
Check4.Enabled = False
End Sub
Private Sub Command3_Click()
With Form6.Adodc1.Recordset
If .BOF Then Form6.Command1.Enabled = False
If .BOF Then Form6.Command5.Enabled = False
End With
Unload Form12
Load Form6
Form6.Show
End Sub
Private Sub Command4_Click()
Form13.Text2.Enabled = False
Form13.Text3.Enabled = False
Form13.Text4.Enabled = False
Form13.Text5.Enabled = False
Form13.Text7.Enabled = False
Form13.Check1.Enabled = False
Form13.Check3.Enabled = False
Form13.Check2.Enabled = False
Form13.Check4.Enabled = False
Form13.cmdAdd.Enabled = False
Form13.Command2.Enabled = False
Form13.Command4.Enabled = False
Form13.Command5.Enabled = False
Form13.Command6.Enabled = False
Form13.Command7.Enabled = False
Load Form13
Form13.Label10.Caption = Text2.Text
Form13.Label11.Caption = Text1.Text
Unload Form12
Form13.Show
End Sub
Private Sub Command5_Click()
Dim bytData() As Byte
Dim strDescription As String
On Error GoTo err
With dlgAdd 'remember the common dialog box.
.CancelError = False
.Filter = "Picture Files (*.jpg, *.gif)|*.jpg;*.gif" 'filtering so only jpg's and gifs are shown!
.DialogTitle = "Select Picture" 'sets the title of it.
.ShowOpen ' show the open dialog box.
Open .FileName For Binary As #1 'bit to "convert" the image to binary.
ReDim bytData(FileLen(.FileName))
End With
Get #1, , bytData
Close #1
With Adodc1.Recordset
.Fields("Picture").AppendChunk bytData 'adding the picture to the db
End With
Exit Sub
err:
If err.Number = 32755 Then 'simple error check.
Else
MsgBox err.Description
err.Clear
End If
End Sub
Private Sub OLE1_Updated(Code As Integer)
End Sub
Private Sub Command6_Click()
Form9.Adodc1.Recordset.Filter = "Code/Model='" & Label10.Caption & "'"
Form9.Command1.Visible = False
Form9.Command3.Visible = False
Load Form9
Form9.Show
End Sub
Private Sub Command7_Click()
Adodc1.Recordset.CancelUpdate
Text1.Enabled = False
Text2.Enabled = False
Text3.Enabled = False
Text7.Enabled = False
Check1.Enabled = False
Check2.Enabled = False
Check3.Enabled = False
Check4.Enabled = False
Command2.Enabled = False
Command4.Enabled = False
Command6.Enabled = False
Command5.Enabled = False
Command1.Enabled = True
Command7.Enabled = False
End Sub
Private Sub Command8_Click()
With dlgAdd
.CancelError = False
.Filter = "Drawing Files (*.prt)|*.xls|All Files (*.*)|*.*|"
.ShowOpen
End With
With Adodc1.Recordset
.Fields("Location").Value = dlgAdd.FileName
End With
Exit Sub
err:
If err.Number = 32755 Then 'simple error check.
Else
MsgBox err.Description
err.Clear
End If
End Sub