"lblTime is not declared"

Im making a library system and im having trouble with displaying the timer for the borrowed book, heres the code..

Public Class Form1

    Private Sub TableBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TableBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.TableBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.LibrarySystemBelleBelleDatabaseDataSet1)
        Timer1.Start()

    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'LibrarySystemBelleBelleDatabaseDataSet1.Table' table. You can move, or remove it, as needed.
        Me.TableTableAdapter.Fill(Me.LibrarySystemBelleBelleDatabaseDataSet1.Table)

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        lblTime.Text = TimeString
    End Sub
End Class
Maribel SilvestreStudentAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Olatunde Francis OyeyemiConnect With a Mentor Commented:
From here
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        lblTime.Text = TimeString
    End Sub

If am correct lblTime is a label right? Make sure is (lblTime) there on the form, then try this Now.ToString("hh:mm:ss tt") you can use any format you want, if its date and time use Now.ToString("yyyy/MM/dd hh:mm:ss")
Also make sure you enable your Timer.

if error still persist, use this to test
msgbox(Now.ToString("hh:mm:ss")) in place of lblTime.Text = TimeString
0
 
Ryan ChongConnect With a Mentor Commented:
"lblTime is not declared"
make sure you got a control named as lblTime in your form: Form1?
0
 
Maribel SilvestreStudentAuthor Commented:
Thank you for helping!
The timer is already working thank you! :D
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.