Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,165,774 members, 7,862,536 topics. Date: Sunday, 16 June 2024 at 06:58 PM

Ashiya's Posts

Nairaland Forum / Ashiya's Profile / Ashiya's Posts

(1) (of 1 pages)

Programming / Re: Post Ur Vb 6.0 Questions Here by ashiya(f): 9:47am On Dec 28, 2009
i have this new problem in the system im creating, 
at first i can add records but now i cant add record,

here is the code,


Dim flag As Integer
Dim day, stime, tempday As String

Private Sub cmdAdd_Click()
enabletextTime
cleartextTime
flag = 0
txtroomno.SetFocus
End Sub

Private Sub cmddelete_Click()
If rsRoom_Schedule.RecordCount = 0 Then
MsgBox "Database Empty", vbInformation, "Delete Record"
cmddelete.Enabled = False
Exit Sub
End If
If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "Delete Record"wink = vbYes Then
rsRoom_Schedule.Delete
MsgBox "Record deleted", vbInformation + vbOKOnly, "Delete Record"
cleartextTime
End If
End Sub

Private Sub cmdEdit_Click()
enabletextTime
flag = 1
End Sub

Private Sub cmdsave_Click()
If txtroomno.Text = "" Then
MsgBox "Enter a Room No. before proceeding.", vbInformation + vbOKOnly, "Incomplete Information"
txtroomno.SetFocus
Exit Sub
End If
If txtcode.Text = "" Then
MsgBox "Enter a Class Code before proceeding.", vbInformation + vbOKOnly, "Incomplete Information"
txtcode.SetFocus
Exit Sub
End If
If txtfacultycode.Text = "" Then
MsgBox "Enter a Faculty Code before you continue.", vbInformation + vbOKOnly, "Incomplete Information"
txtfacultycode.SetFocus
Exit Sub
End If
If txtsubject.Text = "" Then
MsgBox "Enter a Subject Code before you proceed.", vbInformation + vbOKOnly, "Incomplete Information"
txtsubject.SetFocus
Exit Sub
End If
If txtsy.Text = "" Then
MsgBox "Enter a School Year before you proceed.", vbInformation + vbOKOnly, "Incomplete Information"
txtsy.SetFocus
Exit Sub
End If
If cboSem.Text = "" Then
MsgBox "Choose a Semester before you continue.", vbInformation + vbOKOnly, "Incomplete Information"
cboSem.SetFocus
Exit Sub
End If
If cboday.Text = "" Then
MsgBox "Choose a Schedule Day before you continue.", vbInformation + vbOKOnly, "Incomplete Information"
cboday.SetFocus
Exit Sub
End If
If cbostart.Text = "" Then
MsgBox "Choose a Start Time before you proceed.", vbInformation + vbOKOnly, "Incomplete Information"
cbostart.SetFocus
Exit Sub
End If
If cboend.Text = "" Then
MsgBox "Choose an End Time before you proceed.", vbInformation + vbOKOnly, "Incomplete Information"
cboend.SetFocus
Exit Sub
End If

If flag = 1 Then
With Room_Schedule
    .Fields(0) = txrtroomno.Text
    .Fields(1) = txtcode.Text
    .Fields(2) = txtfacultycode.Text
    .Fields(3) = txtsubject.Text
    .Fields(4) = txtsy.Text
    .Fields(5) = cboSem.Text
    .Fields(6) = cboday.Text
    .Fields(7) = txtstart.Text
    .Fields(cool = txtend.Text
    .Update
    MsgBox "Room Schedule Updated!", vbInformation, "Save Record"
    cmdsave.Caption = "Save"
End With
ElseIf flag = 0 Then
    With rsRoom_Schedule
    .Find "Room_No='" & txtroomno.Text & "'", 0, adSearchForward, 1
        If .EOF = False Then
        .Find "School_Year='" & txtsy.Text & "'", 0, adSearchForward, 1
            If .EOF = False Then
            .Find "Semester='" & cboSem.Text & "'", 0, adSearchForward, 1
                If .EOF = False Then
                .Find "Day='" & cboday.Text & "'", 0, adSearchForward, 1
                        tempday = cboday.Text
                        If .EOF = False Then
                        day = .Fields(6)
                        If cboday.Text = day Then
                        .Find "Start_Time='" & cbostart.Text & "'", 0, adSearchForward, 1
                        If .EOF = False Then '1
                        stime = .Fields(7)
                        If day = cboday.Text And stime = cbostart.Text Then
                        MsgBox "Schedule Time already exist!", vbInformation, "Save Record"
                        cbostart.SetFocus
                        cbostart.Text = ""
                        Exit Sub
                        ElseIf day = cboday And stime <> cbostart.Text Then 'If .EOF = True Then 'same day different time
                        .AddNew
                        .Fields(0) = txtroomno.Text
                        .Fields(1) = txtcode.Text
                        .Fields(2) = txtfacultycode.Text
                        .Fields(3) = txtsubject.Text
                        .Fields(4) = txtsy.Text
                        .Fields(5) = cboSem.Text
                        .Fields(6) = cboday.Text
                        .Fields(7) = cbostart.Text
                        .Fields(cool = cboend.Text
                        .Update
                        MsgBox "New Room Schedule Save!", vbInformation, "Save Record"
                        End If
                        ElseIf day <> cboday And stime <> cbostart.Text Then
                        .AddNew
                    .Fields(0) = txtroomno.Text
                    .Fields(1) = txtcode.Text
                    .Fields(2) = txtfacultycode.Text
                    .Fields(3) = txtsubject.Text
                    .Fields(4) = txtsy.Text
                    .Fields(5) = cboSem.Text
                    .Fields(6) = cboday.Text
                    .Fields(7) = cbostart.Text
                    .Fields(cool = cboend.Text
                    .Update
                    MsgBox "New Room Schedule Save!", vbInformation, "Save Record"
                        End If
                        End If
                        End If
                    Else ' Then 'different day
                    day = cboday.Text
                    .Find "Start_Time='" & cbostart.Text & "'", 0, adSearchForward, 1
                    stime = .Fields(7)
                    If .EOF = False Then
                    MsgBox "Schedule already exist!", vbInformation, "Save Record"
                    cbostart.SetFocus
                    cbostart.Text = ""
                    Exit Sub
                    Else 'If stime <> cbostart.Text Then 'different time
                    .AddNew
                    .Fields(0) = txtroomno.Text
                    .Fields(1) = txtcode.Text
                    .Fields(2) = txtfacultycode.Text
                    .Fields(3) = txtsubject.Text
                    .Fields(4) = txtsy.Text
                    .Fields(5) = cboSem.Text
                    .Fields(6) = cboday.Text
                    .Fields(7) = cbostart.Text
                    .Fields(cool = cboend.Text
                    .Update
                    MsgBox "New Room Schedule Save!", vbInformation, "Save Record"
                 
                    End If
                    End If
                    End If
                 
        'elseIf .EOF = True Then 'different sem
        '.Find "Day='" & cboday.Text & "'", 0, adSearchForward, 1
        'If .EOF = False Then
        '.Find "Start_Time='" & txtstart.Text & "'", 0, adSearchForward, 1
        'If .EOF = False Then
        '    MsgBox "Schedule already exist!", vbInformation, "Save Record"
        '    txtstart.SetFocus
        '    txtstart.Text = ""
        '    Exit Sub
        'Else 'same day different time
        '    .AddNew
        '    .Fields(0) = txrtroomno.Text
        '    .Fields(1) = txtcode.Text
        '    .Fields(2) = txtfacultycode.Text
        '    .Fields(3) = txtsubject.Text
        '    .Fields(4) = txtsy.Text
        '    .Fields(5) = cboSem.Text
        '    .Fields(6) = cboday.Text
        '    .Fields(7) = txtstart.Text
        '    .Fields(cool = txtend.Text
        '    .Update
        '    MsgBox "New Room Schedule Save!", vbInformation, "Save Record"
        End If
       
       
    End With
End If
disabletextTime
cleartextTime
End Sub

Private Sub dtgSchedule_Click()
With rsRoom_Schedule
            txtroomno.Text = .Fields(0)
            txtcode.Text = .Fields(1)
            txtfacultycode.Text = .Fields(2)
            txtsubject.Text = .Fields(3)
            txtsy.Text = .Fields(4)
            cboSem.Text = .Fields(5)
            cboday.Text = .Fields(6)
            txtstart.Text = .Fields(7)
            txtend.Text = .Fields(cool
End With
End Sub

Private Sub Form_Load()
Call OpenConnection
disabletextTime
For i = 1 To rsRoom_Schedule.RecordCount
rsRoom_Schedule.MoveNext
Next i
Set dtgSchedule.DataSource = rsRoom_Schedule
End Sub

Private Sub Form_Unload(Cancel As Integer)
Call CloseConnection
End Sub
Computers / Re: Sites For Downloading Softwares. by ashiya(f): 5:00am On Dec 28, 2009
i need an application to unblock sites that are restricted,
Programming / Re: Post Ur Vb 6.0 Questions Here by ashiya(f): 4:49am On Dec 28, 2009
i have a new problem regarding with the system that im working right now,

i have 2 column and i will add a new record , my input is not same with the 1st column which is the 'day' but in the second column which is the 'time' it says that it has the same record but if in the 'day column' my input are not same it should not have any problem with the 'time column',

.Find "Day='" & cboday.Text & "'", 0, adSearchForward, 1

.Find "Start_Time='" & cbostart.Text & "'", 0, adSearchForward, 1

what can the solution to this

tnx in advance,
Programming / Re: Post Ur Vb 6.0 Questions Here by ashiya(f): 3:03am On Dec 28, 2009
i have this error whenever i add a new record in the database,  'operation is not allowed when the object is open'
pls help me,  i need a lot,  tnx to those who will reply,  smiley


con.Open "Description=laboratory;DRIVER=SQL Server;SERVER=(local);APP=Visual Basic;WSID=HELICON-CRIS;DATABASE=laboratory;Trusted_Connection=Yes"


here's the connection string that i uses, many tnx
Programming / Re: Post Ur Vb 6.0 Questions Here by ashiya(f): 2:37am On Dec 24, 2009
i just want to ask, is it possible to make a system that will manipulate the other pc and also get the list of applications that the user use with that pc and also the files he created using vb 6.0??
Programming / Re: Post Ur Vb 6.0 Questions Here by ashiya(f): 4:27pm On Dec 19, 2009
cant view my first input in the datagrid, however the other data i entered is there, and also 'bookmark is invalid appear' when i save the data to the database,

what is the problem

help me please,

im using ms sql server,, tnx

(1) (of 1 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 27
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.