VS 2015 [RESOLVED] How to update whole table records with one single button click?-VBForums
Results 1 to 30 of 30

Thread: [RESOLVED] How to update whole table records with one single button click?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Resolved [RESOLVED] How to update whole table records with one single button click?

    I want to use the following function "Spaces" in update query and to update the whole table records just in a single button click (to remove any unwanted spaces from the reocrds which wered already added earlier by mistake) instead of updating each record one by one. Because now, I have more than 6300 records in my MS Access database.

    Note: I am not going to change any text / values in the textboxes. Simply I want to click on Edit button then click on Update button to remove unwanted spaces from table records.
    These (around 6300) records were added earlier without using Spaces function.

    Code:
     Private Function Spaces(strText As String) As String
            Return String.Join(" ", strText.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
        End Function
    Code:
    Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
    
            Dim CurrencyTextboxes() As TextBox = {txt17, txt18, txt19, txt20, txt22, txt23, txt24, txt25, txt26, txt27, txt28, txt29, txt30, txt31, txt32, txt33, txt34, txt36, txtTQty, txtTAmt, txtTDiscount, txtTTaxableValue, txtTCGST, txtSGST, txtInvoiceAmt, txtTTax, txtTInvoiceValue}
    
            For Each TB As TextBox In CurrencyTextboxes
                If TB.Text = "" Then TB.Text = 0.00
            Next
    
            If btnSave.Text = "Save" Then
                Dim StrSql = "INSERT INTO NewSalesDBTable (A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16,A17,A18,A19,A20,A21,A22,A23,A24,A25,A26,A27,A28,A29,A30,A31,A32,A33,A34,A35,A36,A37,UDO,UDB) VALUES('" _
                             + Spaces(Me.txt1.Text) + "','" _
                             + Spaces(Me.txt2.Text) + "','" _
                             + Spaces(Me.txt3.Text) + "','" _
                             + Spaces(Me.txt4.Text) + "','" _
                             + Spaces(Me.txt5.Text) + "','" _
                             + Spaces(Me.txt6.Text) + "','" _
                             + Spaces(Me.txt7.Text) + "','" _
                             + Spaces(Me.txt8.Text) + "','" _
                             + Spaces(Me.txt9.Text) + "','" _
                             + Spaces(Me.txt10.Text) + "','" _
                             + Spaces(Me.txt11.Text) + "','" _
                             + Spaces(Me.txt12.Text) + "','" _
                             + Spaces(Me.txt13.Text) + "','" _
                             + Spaces(Me.txt14.Text) + "','" _
                             + Spaces(Me.txt15.Text) + "','" _
                             + Spaces(Me.txt16.Text) + "','" _
                             + Spaces(Me.txt17.Text) + "','" _
                             + Spaces(Me.txt18.Text) + "','" _
                             + Spaces(Me.txt19.Text) + "','" _
                             + Spaces(Me.txt20.Text) + "','" _
                             + Spaces(Me.txt21.Text) + "','" _
                             + Spaces(Me.txt22.Text) + "','" _
                             + Spaces(Me.txt23.Text) + "','" _
                             + Spaces(Me.txt24.Text) + "','" _
                             + Spaces(Me.txt25.Text) + "','" _
                             + Spaces(Me.txt26.Text) + "','" _
                             + Spaces(Me.txt27.Text) + "','" _
                             + Spaces(Me.txt28.Text) + "','" _
                             + Spaces(Me.txt29.Text) + "','" _
                             + Spaces(Me.txt30.Text) + "','" _
                             + Spaces(Me.txt31.Text) + "','" _
                             + Spaces(Me.txt32.Text) + "','" _
                             + Spaces(Me.txt33.Text) + "','" _
                             + Spaces(Me.txt34.Text) + "','" _
                             + Spaces(Me.txt35.Text) + "','" _
                             + Spaces(Me.txt36.Text) + "','" _
                             + Spaces(Me.txt37.Text) + "','" _
                             + Spaces(Me.txtUDO.Text) + "','" _
                             + Spaces(Me.txtUDB.Text) + "')"
    
                Dim dt As New DataTable
                If Not DAL.ExecuteSql(dt, StrSql, Msg) Then MsgBox(Msg, MsgBoxStyle.Exclamation, "Error") : Exit Sub
    
            Else
    
                Dim StrSql = "UPDATE NewSalesDBTable SET " _
                             + "A1='" + Spaces(Me.txt1.Text) + "'," _
                             + "A2='" + Spaces(Me.txt2.Text) + "'," _
                             + "A3='" + Spaces(Me.txt3.Text) + "'," _
                             + "A4='" + Spaces(Me.txt4.Text) + "'," _
                             + "A5='" + Spaces(Me.txt5.Text) + "'," _
                             + "A6='" + Spaces(Me.txt6.Text) + "'," _
                             + "A7='" + Spaces(Me.txt7.Text) + "'," _
                             + "A8='" + Spaces(Me.txt8.Text) + "'," _
                             + "A9='" + Spaces(Me.txt9.Text) + "'," _
                             + "A10='" + Spaces(Me.txt10.Text) + "'," _
                             + "A11='" + Spaces(Me.txt11.Text) + "'," _
                             + "A12='" + Spaces(Me.txt12.Text) + "'," _
                             + "A13='" + Spaces(Me.txt13.Text) + "'," _
                             + "A14='" + Spaces(Me.txt14.Text) + "'," _
                             + "A15='" + Spaces(Me.txt15.Text) + "'," _
                             + "A16='" + Spaces(Me.txt16.Text) + "'," _
                             + "A17='" + Spaces(Me.txt17.Text) + "'," _
                             + "A18='" + Spaces(Me.txt18.Text) + "'," _
                             + "A19='" + Spaces(Me.txt19.Text) + "'," _
                             + "A20='" + Spaces(Me.txt20.Text) + "'," _
                             + "A21='" + Spaces(Me.txt21.Text) + "'," _
                             + "A22='" + Spaces(Me.txt22.Text) + "'," _
                             + "A23='" + Spaces(Me.txt23.Text) + "'," _
                             + "A24='" + Spaces(Me.txt24.Text) + "'," _
                             + "A25='" + Spaces(Me.txt25.Text) + "'," _
                             + "A26='" + Spaces(Me.txt26.Text) + "'," _
                             + "A27='" + Spaces(Me.txt27.Text) + "'," _
                             + "A28='" + Spaces(Me.txt28.Text) + "'," _
                             + "A29='" + Spaces(Me.txt29.Text) + "'," _
                             + "A30='" + Spaces(Me.txt30.Text) + "'," _
                             + "A31='" + Spaces(Me.txt31.Text) + "'," _
                             + "A32='" + Spaces(Me.txt32.Text) + "'," _
                             + "A33='" + Spaces(Me.txt33.Text) + "'," _
                             + "A34='" + Spaces(Me.txt34.Text) + "'," _
                             + "A35='" + Spaces(Me.txt35.Text) + "'," _
                             + "A36='" + Spaces(Me.txt36.Text) + "'," _
                             + "A37='" + Spaces(Me.txt37.Text) + "'," _
                             + "UDO='" + Spaces(Me.txtUDO.Text) + "'," _
                             + "UDB='" + Spaces(Me.txtUDB.Text) + "' Where [TINVID] = " & txtID.Text
    
                Dim dt As New DataTable
                If Not DAL.ExecuteSql(dt, StrSql, Msg) Then MsgBox(Msg, MsgBoxStyle.Exclamation, "Error") : Exit Sub
            End If
        End Sub
    Last edited by VS2013; Jan 28th, 2018 at 02:54 PM.

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,524

    Re: How to update whole table records with one single button click?

    If I wanted to update all the records in a Database Table, I would do it like this,

    Code:
            Dim da As New OleDbDataAdapter("Select fields you want to Edit From yourTable", yourConnectionString)
            Dim cb As New OleDbCommandBuilder(da)
            Dim dt As New DataTable
    
            da.Fill(dt)
    
            For Each row As DataRow In dt.Rows
                For Each col As DataColumn In dt.Columns
                    row(col) = "new value"
                Next
            Next
    
            da.Update(dt)
    I didn't really test this, just wrote it as an example.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    Where can I use the function called "Spaces" in the above code?

  4. #4
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,524

    Re: How to update whole table records with one single button click?

    There's really only one place you could use it. Right?

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    I am not able to figure it out. I am doing something wrong. Please guide me.
    The following is the code:

    Module Name is : DAL.vb
    Code:
    Imports System.Data.OleDb
    Imports System.Data
    Module DAL
        Dim OledbCon As OleDbConnection
        Public Msg As String = String.Empty
        Public Function GetCon() As OleDbConnection
            Dim DbFullPath As String = Application.StartupPath + "\"
            DbFullPath += "RTDataBase.accdb"
            If OledbCon Is Nothing Then
                OledbCon = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + DbFullPath + ";Jet OLEDB:Database Password=TestingPWD;")
                OledbCon.Open()
                Return OledbCon
            End If
            If OledbCon.State = ConnectionState.Open Then Return OledbCon
            OledbCon.Open()
            Return OledbCon
        End Function
        Public Function ExecuteSql(ByRef dt As DataTable, ByVal StrSql As String, ByRef Msg As String) As Boolean
            Try
                Dim Cmd As OleDbCommand = New OleDbCommand(StrSql, GetCon())
                Cmd.CommandType = CommandType.Text
                Dim DA As New OleDbDataAdapter
                DA.SelectCommand = Cmd
                DA.Fill(dt)
                Return True
            Catch ex As Exception
                Msg = ex.Message.ToString()
                Return False
            End Try
        End Function
    End Module
    Code:
       Private Function Spaces(strText As String) As String
            Return String.Join(" ", strText.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
        End Function
    Code:
    Private Sub btnRempveSpaces_Click(sender As Object, e As EventArgs) Handles btnRempveSpaces.Click
            Dim StrSql As String = "Select CustomerName, Address from CustomersTable ORDER BY CustomerName ASC"
            Dim dt As New DataTable
            Dim DA As New OleDbDataAdapter
    
            For Each row As DataRow In dt.Rows
                For Each col As DataColumn In dt.Columns
                    row(col) = "Spaces"
                Next
            Next
    
            DA.Update(dt)
    
            If Not DAL.ExecuteSql(dt, StrSql, Msg) Then MsgBox(Msg, MsgBoxStyle.Exclamation, "Error") : Exit Sub
            Me.DataGridView1.DataSource = dt
            If dt Is Nothing Or dt.Rows.Count <= 0 Then
                Exit Sub
            End If
        End Sub
    End Class
    I think I am doing something wrong here in the above code : row(col) = "Spaces".
    There is no error but it populates two columns CustomerName, Address (Fields) without removing any spaces from those columns.

    Please do help.

  6. #6
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: How to update whole table records with one single button click?

    row(col) = "Spaces"
    replace this
    Code:
    row(col) = Spaces(Me.txt1.Text) & "','"
    'To something more like this

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    Actually, I need to update all the 39 fields in NewSalesDBTable as mentioned in the Post # 1. I was trying to check first with 2 Fields in CustomersTable in the above post. How can I proceed further? Got confused. Do I need to add the same line of code for each textbox (for all 39 Fields) like...
    row(col) = Spaces(Me.txt1.Text) & "','"
    row(col) = Spaces(Me.txt2.Text) & "','"
    row(col) = Spaces(Me.txt3.Text) & "','" ................................................
    row(col) = Spaces(Me.txt37.Text) & "','"
    row(col) = Spaces(Me.txtUDO.Text) & "','"
    row(col) = Spaces(Me.txtUDB.Text) & "','"

  8. #8
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: How to update whole table records with one single button click?

    I just noticed the code is first iterating cols then rows.
    You may want to do it manually instead

    Code:
            With dt
                .Rows(0)("Col1Name") = Spaces(Me.txt1.Text) & "','"
                .Rows(0)("Col2Name") = Spaces(Me.txt2.Text) & "','"
            End With

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    For testing, I put one Button and one DataGridView on form thinking that the textboxes are not required to update the whole table in one click. Please support how can I proceed further?

    Note: Now, my problem is that I cannot go row by row and udpate it, as it has more than 6,300 records already entered.
    Attached Images Attached Images  
    Last edited by VS2013; Feb 2nd, 2018 at 11:52 AM.

  10. #10
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: How to update whole table records with one single button click?

    I prefer using a bindingsource to interact with dt
    Code:
            Dim bs As New BindingSource With {.DataSource = dt}
            CType(bs.Current, DataRowView)("Col1Name") = Spaces(Me.txt1.Text) & "','"
            CType(bs.Current, DataRowView)("Col2Name") = Spaces(Me.txt2.Text) & "','"
            bs.EndEdit()
            da.Update(dt)

  11. #11
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: How to update whole table records with one single button click?

    Quote Originally Posted by VS2013 View Post
    For testing, I put one Button and one DataGridView on form thinking that the textboxes are not required to update the whole table in one click. Please support how can I proceed further?

    Note: Now, my problem is that I cannot go row by row and udpate it, as it has more than 6,300 records already entered.
    At this point I am thinking you want us to write your application

  12. #12
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,461

    Re: How to update whole table records with one single button click?

    Actually it was the wrong answer to the wrong question in the first place... this should have been a SQL question with a SQL answer... especially if he's looking for a one-off to clean up the entire table.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  13. #13
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: How to update whole table records with one single button click?

    I guess it would help to know what the input string looks like and what he expects the output string to be. Probably dont need the function.

  14. #14
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,524

    Re: How to update whole table records with one single button click?

    Private Sub btnRempveSpaces_Click(sender As Object, e As EventArgs) Handles btnRempveSpaces.Click
    Dim StrSql As String = "Select CustomerName, Address from CustomersTable ORDER BY CustomerName ASC"
    Dim dt As New DataTable
    Dim DA As New OleDbDataAdapter

    For Each row As DataRow In dt.Rows
    For Each col As DataColumn In dt.Columns
    row(col) = "Spaces"
    Next
    Next

    DA.Update(dt)

    If Not DAL.ExecuteSql(dt, StrSql, Msg) Then MsgBox(Msg, MsgBoxStyle.Exclamation, "Error") : Exit Sub
    Me.DataGridView1.DataSource = dt
    If dt Is Nothing Or dt.Rows.Count <= 0 Then
    Exit Sub
    End If
    End Sub
    End Class
    This code has several problems. The DataAdapter has not been assigned a CommandText or a Connection String. Once you do that, you need to "Fill" the DataTable. This code does nothing because the datatable has nothing in it.

    Once you fill the datatable then you can use your "Spaces" or replace row(col) = "Spaces"
    Code:
        Dim var = row(col).ToString
        row(col) = String.Join(" ", var.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
    My example is not meant to work with TextBoxes or bindingsources or any type of operator entry. It's meant to be in a Button Click event and it will go though the entire table in one shot.

  15. #15

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    I have the following code in Module:

    Code:
    Imports System.Data.OleDb
    Imports System.Data
    Module DAL
        Dim OledbCon As OleDbConnection
        Public Msg As String = String.Empty
        Public Function GetCon() As OleDbConnection
            Dim DbFullPath As String = Application.StartupPath + "\"
            DbFullPath += "RTDataBase.accdb"
            If OledbCon Is Nothing Then
                OledbCon = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + DbFullPath + ";Jet OLEDB:Database Password=TestingPWD;")
                OledbCon.Open()
                Return OledbCon
            End If
            If OledbCon.State = ConnectionState.Open Then Return OledbCon
            OledbCon.Open()
            Return OledbCon
        End Function
        Public Function ExecuteSql(ByRef dt As DataTable, ByVal StrSql As String, ByRef Msg As String) As Boolean
            Try
                Dim Cmd As OleDbCommand = New OleDbCommand(StrSql, GetCon())
                Cmd.CommandType = CommandType.Text
                Dim DA As New OleDbDataAdapter
                DA.SelectCommand = Cmd
                DA.Fill(dt)
                Return True
            Catch ex As Exception
                Msg = ex.Message.ToString()
                Return False
            End Try
        End Function
    End Module
    Form: FormRemoveSpaces
    Button: btnRemoveSpaces
    Gridview: DataGridView1

    What code exactly do I need to write in Button event btnRemoveSpaces for this purpose including the following suggested code:
    Code:
    Dim var = row(col).ToString
        row(col) = String.Join(" ", var.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
    Extremely sorry for posting here as I didn't know first where it is to be pasted exactly.

  16. #16
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,524

    Re: How to update whole table records with one single button click?

    Code:
            Dim da As New OleDbDataAdapter("Select fields you want to Edit From yourTable", yourConnectionString)
            Dim cb As New OleDbCommandBuilder(da)
            Dim dt As New DataTable
    
            da.Fill(dt)
    
            For Each row As DataRow In dt.Rows
                For Each col As DataColumn In dt.Columns
                       Dim var = row(col).ToString
                      row(col) = String.Join(" ", var.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
                Next
            Next
    
            da.Update(dt)
    What don't you understand???

  17. #17

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    Thank you so much for your kind reply. It is working fine. Just last question in this regard. Some of the fields contain * in brackets with space which are actually not required.

    Like : CUSHION GNTS (4 * 5)
    Actually it should be: CUSHION GNTS (4*5) .................. Without any space inside the brackets' text/values.

  18. #18
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,524

    Re: How to update whole table records with one single button click?

    Quote Originally Posted by VS2013 View Post
    Thank you so much for your kind reply. It is working fine. Just last question in this regard. Some of the fields contain * in brackets with space which are actually not required.

    Like : CUSHION GNTS (4 * 5)
    Actually it should be: CUSHION GNTS (4*5) .................. Without any space inside the brackets' text/values.
    Sorry, I don't know. You should ask that question in a new thread, someone here probably knows how.

  19. #19
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: How to update whole table records with one single button click?

    Are you just trying to remove spaces?
    Code:
            Dim StringWithSpaces = "This String Has A Bunch Of Spaces I DOnt Want ( I Want Them Removed )"
    
            Dim NewString As String = StringWithSpaces.Replace(" ", "")
            MsgBox(NewString)

  20. #20

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    Thanks. But I want to amend the below code to replace spaces before and after the astricks "*" and add one space after the period "." wherever int the string in addition to removing spaces as in the below code.

    Code:
    Dim var = row(col).ToString
                    row(col) = String.Join(" ", var.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
    Note: Remove spaces before and after the astricks "*" wherever in the string. And add one space after the period "."
    Last edited by VS2013; Feb 3rd, 2018 at 04:02 AM.

  21. #21
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,035

    Re: How to update whole table records with one single button click?

    are you really saying that you know how to remove spaces before/after brackets
    but not before/after astericks ?
    do you not understand your own code ?
    also,take a good look at post #12
    do not put off till tomorrow what you can put off forever

  22. #22

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    I don't see any SQL forum here to post it. What is the correct forum name, please? The below code does everything that I wanted to modify my table except to remove space before and after the astrick (*)and to add a single space after period (.).

    Code:
    Dim var = row(col).ToString
                    row(col) = String.Join(" ", var.Split({" "}, StringSplitOptions.RemoveEmptyEntries)).Replace("( ", "(").Replace(" )", ")")
    Note: This code was previously provided by 4x2y in this forum.

  23. #23
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,035

    Re: How to update whole table records with one single button click?

    you realise the period may be someones decimal or thousands separator ?
    do not put off till tomorrow what you can put off forever

  24. #24

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    Okay. In that case, just removing space before and after astrick will be enough.

  25. #25
    Fanatic Member ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    958

    Re: How to update whole table records with one single button click?

    Hi,

    take a look at LTRIM - RTRIM and TRIM

    in a SQL statment in Access..
    Code:
    UPDATE Table1 SET Table1.Field1 = RTrim(Field1);
    EDIT:
    here a Link for SQL https://www.sqlbook.com/sql-string-f...d-common-uses/

    or use Regex
    Code:
    Public Class Form1
    
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            'remove all character within the brackets = ., !'?;:
            'that means [\      ] <- put the characters in there
            TextBox1.Text = System.Text.RegularExpressions.Regex.Replace(TextBox1.Text, "[\., !'?;:]", "")
        End Sub
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            TextBox1.Text = " CUSHION GNTS (4 * 5) ? !;"
        End Sub
    End Class
    but handle all this with care, dont destroy your Data in the Table !!!

    regards
    Chris
    Last edited by ChrisE; Feb 3rd, 2018 at 06:53 AM.
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  26. #26
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,035

    Re: How to update whole table records with one single button click?

    Quote Originally Posted by VS2013 View Post
    Okay. In that case, just removing space before and after astrick will be enough.
    you realise that removing space before and after astrick
    is exackt the same as removing space before and after brackets
    and in a text field (as opposed to a numeric field) the period is not a decimal or thousands separator

    suggestion:
    instead of using that one-liner spaces function
    write your own spaces function
    that does every needed tranformation in a separate line
    and as post#12 suggested:
    that should really be an update query in your database
    do not put off till tomorrow what you can put off forever

  27. #27

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2014
    Posts
    263

    Re: How to update whole table records with one single button click?

    Thanks to all for kind support. I will do the rest manually. Since the major part of the problem is already resolved, I will conclude it as resolved.

  28. #28
    Frenzied Member
    Join Date
    Jun 2014
    Posts
    1,035

    Re: How to update whole table records with one single button click?

    Quote Originally Posted by ChrisE View Post
    but handle all this with care, dont destroy your Data in the Table !!!
    no need to worry about that, his database has kind of self-destruction build in
    do not put off till tomorrow what you can put off forever

  29. #29
    Fanatic Member ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    958

    Re: How to update whole table records with one single button click?

    Quote Originally Posted by IkkeEnGij View Post
    no need to worry about that, his database has kind of self-destruction build in
    yes, sounds dangerous what he wants to do with the data
    let everybody find out on there own

    regards
    Chris
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

  30. #30
    Hyperactive Member
    Join Date
    Sep 2017
    Posts
    309

    Re: [RESOLVED] How to update whole table records with one single button click?

    I feel stoopider after reading through all this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width