Solved

dbgrid buttonclick code sample

Posted on 1997-06-04
5
541 Views
Last Modified: 2012-06-27
I'd just want to have some sample code wherein you use the buttonclick event of a dbgrid that will pulldown a combo box and then update the contents of the column (with the button) based on the user selection.
0
Comment
Question by:junlabao
5 Comments
 
LVL 1

Expert Comment

by:DarkAge
Comment Utility
What version 4 or 5?
0
 

Expert Comment

by:delhaye
Comment Utility
Could you B more explicit ?
You have a DBGrid, a button and a ComboBox ?
And so what ?
0
 

Author Comment

by:junlabao
Comment Utility
I'm using VB 5.  I've got both a dbgrid and a combox control.  In the office, we deal with a lot of codes such as product codes, client codes, ..., etc.  It would really help if we are able to let users click a button from a column in a dbgrid and he will be presented with the available codes from a combo box.  Since I've gathered that it is impossible to put a combobox in a dbgrid control (ala Access in datasheet view), we are stumped on how to do this.  I've checked and there is a property in the dbgrid wherein you you are able to specify to show a button whenever the column in the dbgrid has the focus.  Based on the help files, once the button is clicked a "buttonclick event" will be trigered and you can add code to pulldown a combo box.  The problem is that help doesn't have any sample code.
0
 
LVL 2

Accepted Solution

by:
Jagar earned 70 total points
Comment Utility
I'm not really sure if this is what you looking for, but how about this:  Make the combobox invisible.  Then in the click event of the databound grid move the combobox to the right position on the screen and fill it with the appropriate codes.  Then after the user picks on of these codes in the combobox make it invisible again and copy the code that they picked to the DBGrid.  If you do this make sure the combobox appears on top of the DBGrid, with the ZOrder if necessary.
0
 

Author Comment

by:junlabao
Comment Utility
It would be best if you can provide me with sample code for the buttonclick event of the bounded dbgrid.  How would I let the code know which column currently has the focus (since you will copying the contents of the combobox to the column with the button)?
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

771 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

11 Experts available now in Live!

Get 1:1 Help Now