How do you delete a field?

Posted on 2007-08-02
Last Modified: 2010-04-30
How do you delete a field using ADO from an MSHFlexGrid
Question by:Takamine334
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    you mean, set it to NULL?
    LVL 18

    Accepted Solution

    Lets say the user clicks a row in the grid. Generally when we fill the grid we set the first column's width as 0 and fill that columns with the primary key. Now when the user clicks the row, fill a variable with the value of the first columns data and on press of delete button use this value.

    Dim intPrimary as Integer

    On GridClick:

    On Delete Click:
    strSQL="Delete from MyTable Where MyPrimaryKey=" & intPrimary
    cnConnection.execute strSQL

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Introduction This article makes the case for using two modules in your VBA/VB6 applications to provide both case-sensitive and case-insensitive text comparison operations.  Recently, I solved an EE question using the LIKE function.  In order for th…
    Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now