Solved

Microsoft Data Grid Control: Multiple-Step operation generated errors.

Posted on 2003-12-03
3
213 Views
Last Modified: 2013-12-25
A DataGrid Control is boud to a ADO - Recordset. One of the fields is a Textfield and its lenght is limited to 15 characters. This field is also displayed in the datagrid. After typing characters exceeding 15 characters in this coloumn, the data grid control returns the Multiple Step - error. I'am looking for a method or coloumn-property to limitate the characters for a datagrid - coloumn similar to the maxlenght - property of textfields.
0
Comment
Question by:mbreit
3 Comments
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 125 total points
ID: 9866664
Put some code in against the KeyPress event for the grid.



The following code will ignore any keys pressed in column 2 when the length of column 2 is 15. It will also beep. It assumes your data grid is called 'DataGridName'


Private Sub DataGridName_KeyPress(KeyAscii As Integer)
  If DataGridName.Col = 1 And Len(DataGridName.Text) > 15 Then
     Beep
     KeyAscii = 0
  End If
End Sub


You can make this dynamic if you refer to the DefinedSize property of the field object which your data grid is bound to.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

911 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

22 Experts available now in Live!

Get 1:1 Help Now