"lblTime is not declared"

Posted on 2017-04-16
Last Modified: 2017-04-16
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

    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.

    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
        lblTime.Text = TimeString
    End Sub
End Class
Question by:Maribel Silvestre
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 52

Assisted Solution

by:Ryan Chong
Ryan Chong earned 100 total points
ID: 42094812
"lblTime is not declared"
make sure you got a control named as lblTime in your form: Form1?

Accepted Solution

Olatunde Francis Oyeyemi earned 400 total points
ID: 42094819
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

Author Closing Comment

by:Maribel Silvestre
ID: 42094893
Thank you for helping!
The timer is already working thank you! :D

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Starting up a Project

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question