Solved

dbgrid buttonclick code sample

Posted on 1997-06-04
5
610 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
[X]
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
5 Comments
 
LVL 1

Expert Comment

by:DarkAge
ID: 1426875
What version 4 or 5?
0
 

Expert Comment

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

Author Comment

by:junlabao
ID: 1426877
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
ID: 1426878
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
ID: 1426879
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MS Access - Capture pressed key onclick 4 46
vb6 connector to SQL Server 2 42
vb6 connector to mongodb 2 160
Copy a range from 1..n excel sheets to one destination sheet 2 71
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

738 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