"lblTime is not declared"

Posted on 2017-04-16
Medium Priority
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 53

Assisted Solution

by:Ryan Chong
Ryan Chong earned 400 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 1600 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Starting up a Project
Suggested Courses

777 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