Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 6th, 2007, 04:40 AM
Registered User
 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Motor Database System (MDS)

Hi...

A motor database system that I came up with... please do feedback with any useful comments to improve it. Thanks

Option Compare Database

Private Sub Command182_Click()
Dim x As String
Dim y As String

Select Case Combo178.ListIndex
Case 0
    x = "KKS_NO"
Case 1
    x = "M_TYPES"
Case 2
    x = "KW"
Case 3
    x = "P"
Case 4
    x = "I"
Case 5
    x = "RPM"
Case 6
    x = "AMPS"
Case 7
    x = "VOLTS"
Case 8
    x = "WORK_DONE"
Case 9
    x = "FRAME"
Case 10
    x = "BRAND"
Case 11
    x = "MODEL"
Case 12
    x = "SERIAL"
Case 13
    x = "DE_BRG"
Case 14
    x = "NDE_BRG"
Case 15
    x = "WEIGHT"
End Select

Text180.SetFocus
y = Text180.Text

Form.SetFocus
Form.Filter = "(" + "(" + "[" + Form.RecordSource + "]" + "." + x + " like " + "'" + "*" + y + "*" + "'" + ")" + ")"
Form.FilterOn = True
End Sub

Private Sub Command253_Click()
Dim x As String

CCP_Number.SetFocus
x = CCP_Number.Text
If Not (CCP_Number.Text = "3" Or CCP_Number.Text = "4" Or CCP_Number.Text = "5") Then
    x = MsgBox("Please insert a valid CCP Number", vbOKOnly, "Invalid CCP Number")
Else
    Form.RecordSource = "CCP" + x + " " + "SPEC"
    Page30.Visible = True
    Page30.SetFocus
End If
End Sub

Private Sub Exit_Click()
Page30.Visible = False

On Error GoTo Err_Exit_Click


    DoCmd.Quit

Exit_Exit_Click:
    Exit Sub

Err_Exit_Click:
    MsgBox Err.Description
    Resume Exit_Exit_Click

End Sub
Private Sub Enter_Click()
On Error GoTo Err_Enter_Click


    Screen.PreviousControl.SetFocus
    DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70

Exit_Enter_Click:
    Exit Sub

Err_Enter_Click:
    MsgBox Err.Description
    Resume Exit_Enter_Click

End Sub

Private Sub Command281_Click()
Close_Program_Click
End Sub

Private Sub Detail_Click()

End Sub

Private Sub PrintReport_Click()
On Error GoTo Err_PrintReport_Click

    Dim stDocName As String

    stDocName = "Motor Order Database Management System"
    DoCmd.OpenReport stDocName, acNormal

Exit_PrintReport_Click:
    Exit Sub

Err_PrintReport_Click:
    MsgBox Err.Description
    Resume Exit_PrintReport_Click

End Sub
Private Sub PreviewReport_Click()
On Error GoTo Err_PreviewReport_Click

    Dim stDocName As String

    stDocName = "Motor Order Database Management System"
    DoCmd.OpenReport stDocName, acPreview

Exit_PreviewReport_Click:
    Exit Sub

Err_PreviewReport_Click:
    MsgBox Err.Description
    Resume Exit_PreviewReport_Click

End Sub
Private Sub Close_Program_Click()
On Error GoTo Err_Close_Program_Click


    DoCmd.Quit

Exit_Close_Program_Click:
    Exit Sub

Err_Close_Program_Click:
    MsgBox Err.Description
    Resume Exit_Close_Program_Click

End Sub
Sub comboAddItem(ByVal strItemToAdd As String)
    If Combo178.RowSource = "" Then
        Combo178.RowSource = IIf(Combo178.RowSource = "", strItemToAdd, "")
    Else
        Combo178.RowSource = Combo178.RowSource & ";" & strItemToAdd
    End If
End Sub

Private Sub Form_Load()
Combo178.RowSource = ""
comboAddItem ("KKS Number")
comboAddItem ("Motor Description")
comboAddItem ("Rated Power (kW)")
comboAddItem ("Number of Poles")
comboAddItem ("Insulation Class")
comboAddItem ("Speed (rpm)")
comboAddItem ("Rated Current (A)")
comboAddItem ("Rated Voltage (V)")
comboAddItem ("Work Carried Out")
comboAddItem ("Frame Size")
comboAddItem ("Brand")
comboAddItem ("Model/ Type")
comboAddItem ("Serial Number")
comboAddItem ("Driving-end Brg")
comboAddItem ("NDriving-end Brg")
comboAddItem ("Weight (kg)")
End Sub

This is the vb code used to link to the Access 2000 interface
 
Old June 6th, 2007, 04:57 AM
Registered User
 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Links to the pictures showing the access2000 interface will be included in a while.
 
Old June 6th, 2007, 05:08 AM
Registered User
 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Links to interface pictures

http://new.photos.yahoo.com/access_v...elancer/albums
 
Old June 6th, 2007, 07:34 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

it will be hard to point you in any direction without knowing is something is wrong or slow or has any problem...

if it work, let it go ;)

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old June 6th, 2007, 07:42 AM
Registered User
 
Join Date: Jun 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

haha oh well...it works...hmm jus feel something lacking though





Similar Threads
Thread Thread Starter Forum Replies Last Post
request for database design for email system kumiko SQL Language 0 May 13th, 2008 10:26 PM
question about master system database hertendreef SQL Server 2005 2 March 29th, 2007 01:50 AM
Possible to query a System Database File (.sdb) dr185026 SQL Language 0 November 1st, 2006 02:17 PM
Internet Database System Information pshan33 MySQL 4 October 6th, 2003 12:18 PM
ACCESS is an internet database system? sotsot82 Access 1 September 24th, 2003 12:09 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.