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
Solved

Updating Label showing Access Record

Posted on 2007-03-22
2
216 Views
Last Modified: 2010-04-23
vb.net 2003
access 2003

I have a lable on my from that I would like to see what record I'am on in this loop

LabelRec

Can I have the Label Updated as I loop through this access table records ?

Dim dbConnection As Data.OleDb.OleDbConnection
        Dim dbCommand As Data.OleDb.OleDbCommand
        Dim dbDataAdapter As Data.OleDb.OleDbDataAdapter
        Dim dbCommandBuilder As Data.OleDb.OleDbCommandBuilder
        Dim dbDataSet As Data.DataSet

        dbConnection = New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\DM2007\SkuCat.mdb;User Id=admin;Password=;")

        dbConnection.Open()
        dbCommand = New Data.OleDb.OleDbCommand("SELECT * FROM tblData", dbConnection)
        dbDataAdapter = New Data.OleDb.OleDbDataAdapter(dbCommand)
        dbCommandBuilder = New Data.OleDb.OleDbCommandBuilder(dbDataAdapter)
        dbDataSet = New Data.DataSet

        dbDataAdapter.Fill(dbDataSet, "tblData")

        With dbDataSet.Tables("tblData")
            For Each dbRow As Data.DataRow In dbDataSet.Tables("tblData").Rows
                ' regular function
  ' regex dot if not surrounded by Numerics  01172007
                dbRow.Item("fldDescription") = Regex.Replace(dbRow.Item("fldDescription"), _
                        "(?<1>[a-zA-Z])(?<2>\.)(?<3>\d)|(?<1>\d)(?<2>\.)(?<3>[a-zA-Z])", "$1 $3")

 '  regex Deleting Dot/periods if not surrounded by Numerics H.H  Y.C
                dbRow.Item("fldDescription") = Regex.Replace(dbRow.Item("fldDescription"), _
                   "([a-zA-Z])(\.)([a-zA-Z])", "$1 $3")

                ' regex slash if not surrounded by Numerics   G/G   Y/Y
                dbRow.Item("fldDescription") = Regex.Replace(dbRow.Item("fldDescription"), _
                   "([a-zA-Z])(\/)([a-zA-Z])", "$1 $3")
            Next
        End With

        dbDataAdapter.Update(dbDataSet, "tblData")

        dbConnection.Close()
       

Thanks fordraiders
0
Comment
Question by:fordraiders
2 Comments
 
LVL 6

Accepted Solution

by:
kerryw60 earned 500 total points
ID: 18772350
Can I have the Label Updated as I loop through this access table records ?

Yes, but it will change so fast, you will not be able to see it as the code will move through the records too fast.  It will just look as though your label displays the last record.

myLabel.Text = myValue.ToString()

0
 
LVL 3

Author Comment

by:fordraiders
ID: 18775511
Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

839 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