How to autopopulate a couple of textboxes from a database table?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lindoro
    New Member
    • Mar 2012
    • 2

    How to autopopulate a couple of textboxes from a database table?

    I am new to VB world and developing an application which has to identify a person using their fingerprint, and i have to autopopulate the textboxes from the database depending upon who has logged in (the returned fingerprint ID from a scanner). That is, once the userid has been obtained from a reader then autopopulating the textbox fields i.e. family name, address, birthday, etc. Your post looks similar to what i need, except it gives me an "object expected" error on DAO.Datebase can you pl. explain the procedure in detail, or perhaps give some sample code to understand it.

    I don't think the code I'm currently using does anything

    Code:
    TextBox1.Text = dt.Rows(0)("ColumnName1").ToString()  'Where ColumnName is the Field from the DB that you want to display
            TextBox2.Text = dt.Rows(0)("ColumnName2").ToString()
            Label1.Text = dt.Rows(0)("ColumnName3").ToString()
            Label2.Text = dt.Rows(0)("ColumnName4").ToString()
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32633

    #2
    Fundamentally, you need to design a form which displays the values for all records from the table where you hold data related to the operators who can use your database. You then need to use the value returned from the scanner to filter that form to show only the related record. We can't be much help there as your question has so little informatoin included that we're working mostly on guesswork, but Example Filtering on a Form may help you with the concept of filtering forms.

    Comment

    • lindoro
      New Member
      • Mar 2012
      • 2

      #3
      Thanks for that. It's the type of information I need.
      Last edited by NeoPa; Mar 1 '12, 09:26 PM. Reason: Removed unnecessary quote.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32633

        #4
        Pleased to hear it :-)

        Good luck with your project.

        Comment

        Working...