Reminder form again!!!!!!!!!!!!!!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • THEAF
    New Member
    • Mar 2007
    • 52

    Reminder form again!!!!!!!!!!!!!!!!

    OK,
    i've had quite a few problems with this form and again i have another one. i'm using vb6 and access.
    THIS IS MY FORM LOAD AND AFTER THE LOOP IS WHERE THE REMINDER CODE IS
    Private Sub Form_Load()
    '
    Dim s() As String
    Dim ListTime As String
    Dim ListDate As String
    Dim i As Integer

    Set dbReminder = OpenDatabase(Ap p.Path & "\Password.mdb" )
    Set rsReminder = dbReminder.Open Recordset("Remi nder", dbOpenDynaset)

    If Not rsReminder.EOF Then rsReminder.Move First

    Do While Not rsReminder.EOF
    lstReminder.Add Item rsReminder!Rno & "." & " " & rsReminder!name & vbTab & vbTab & rsReminder!Date & vbTab & rsReminder!Time
    lstReminder.Ite mData(lstRemind er.NewIndex) = rsReminder!Rno
    rsReminder.Move Next
    Loop

    Set dbReminder = OpenDatabase(Ap p.Path & "\Password.mdb" )
    Set rsReminder = dbReminder.Open Recordset("Remi nder", dbOpenDynaset)


    For i = 0 To lstReminder.Lis tCount - 1
    s = Split(lstRemind er.List(i), vbTab)
    ListTime = Mid(s(UBound(s) ), 1, Len(s(UBound(s) )) - 3)
    ListDate = s(UBound(s) - 1)
    If ListTime = Mid(Time, 1, Len(Time) - 3) And ListDate = Date Then
    MsgBox lstReminder!Nam e
    End If

    Next
    End Sub

    And i'm using a list box to show these reminders. I'm have very low level knowledge on VB codeing so my mate helped me on the code and is know unavaliable. Anyway the problem with the code is that when a reminder with a time and date equals the actual time and date then the message box show but it only shows the first reminder in the list box not the acutal reminder.

    And the reason i put the code "Set dbReminder" after the loop is because if it were missing the code woundn't run and this was all i could do.
    please give me an answer.
  • Computer Guru
    New Member
    • Mar 2008
    • 16

    #2
    Originally posted by THEAF
    OK,
    i've had quite a few problems with this form and again i have another one. i'm using vb6 and access.
    THIS IS MY FORM LOAD AND AFTER THE LOOP IS WHERE THE REMINDER CODE IS
    Private Sub Form_Load()
    '
    Dim s() As String
    Dim ListTime As String
    Dim ListDate As String
    Dim i As Integer

    Set dbReminder = OpenDatabase(Ap p.Path & "\Password.mdb" )
    Set rsReminder = dbReminder.Open Recordset("Remi nder", dbOpenDynaset)

    If Not rsReminder.EOF Then rsReminder.Move First

    Do While Not rsReminder.EOF
    lstReminder.Add Item rsReminder!Rno & "." & " " & rsReminder!name & vbTab & vbTab & rsReminder!Date & vbTab & rsReminder!Time
    lstReminder.Ite mData(lstRemind er.NewIndex) = rsReminder!Rno
    rsReminder.Move Next
    Loop

    Set dbReminder = OpenDatabase(Ap p.Path & "\Password.mdb" )
    Set rsReminder = dbReminder.Open Recordset("Remi nder", dbOpenDynaset)


    For i = 0 To lstReminder.Lis tCount - 1
    s = Split(lstRemind er.List(i), vbTab)
    ListTime = Mid(s(UBound(s) ), 1, Len(s(UBound(s) )) - 3)
    ListDate = s(UBound(s) - 1)
    If ListTime = Mid(Time, 1, Len(Time) - 3) And ListDate = Date Then
    MsgBox lstReminder!Nam e
    End If

    Next
    End Sub

    And i'm using a list box to show these reminders. I'm have very low level knowledge on VB codeing so my mate helped me on the code and is know unavaliable. Anyway the problem with the code is that when a reminder with a time and date equals the actual time and date then the message box show but it only shows the first reminder in the list box not the acutal reminder.

    And the reason i put the code "Set dbReminder" after the loop is because if it were missing the code woundn't run and this was all i could do.
    please give me an answer.
    The simplest solution I can think of is to have an if statement stating...

    'New hidden label & timer interval = 100

    Timer1_Tick ()
    label.text = "Date&Time"
    End Sub

    'Add to...
    Form1_Load ()
    Timer1.Enabled = True

    If Label.Text = "Date&Time" Then
    MsgBox("Reminde r Here")
    End If

    End Sub

    End Class

    If this does not work, improvise "Custom If Statement"

    Computer Guru

    Comment

    Working...