?
Solved

dbgrid buttonclick code sample

Posted on 1997-06-04
5
Medium Priority
?
629 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

800 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