Solved

"lblTime is not declared"

Posted on 2017-04-16
3
30 Views
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
        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
0
Comment
Question by:Maribel Silvestre
[X]
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
3 Comments
 
LVL 51

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?
0
 

Accepted Solution

by:
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
0
 

Author Closing Comment

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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

756 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