Solved

dbgrid buttonclick code sample

Posted on 1997-06-04
5
558 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
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

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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…

863 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

18 Experts available now in Live!

Get 1:1 Help Now