Solved

Grid Control - which will be easier ?

Posted on 2004-09-16
11
220 Views
Last Modified: 2010-05-02
Hi
Which data grid or flex grid can i use for the following
i need to show a grid with 10 cells and 3 rows.

my user wants to be able to enter say 10 in cell0 and 100 in cell9
i need to then apply a basic formula that will then automatically
populat the rest fo the cells.

Basically i need to be able to program or code around the cells, the user is
uing excel at the moment,

i then need to tkae the values he has entered and then proces sthem into a specific
table in an access dataabse. My user also wants to be able to copy and paste say 10 cells
from excel into my gird on the form

does anyone have some suggestions and samlpe code please

thanks

0
Comment
Question by:CraigLazar
  • 6
  • 5
11 Comments
 
LVL 15

Expert Comment

by:unknown_routine
ID: 12074415
Hi,

Go for flexgrid, it has more functionality.

To be able to edit the cells use this:

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q201/1/97.asp&NoWebContent=1


<<my user wants to be able to enter say 10 in cell0 and 100 in cell9
i need to then apply a basic formula that will then automatically
populat the rest fo the cells.>>>

This is easy: you the textmatrix property and write a basic function to do this.
<<i then need to tkae the values he has entered and then proces sthem into a specific
table in an access dataabse. >>

Again this is basic Database operation. you use a recordset and set its values to the cell values and update the database.



<<My user also wants to be able to copy and paste say 10 cells
from excel into my gird on the form>>

This is probably the  hardest part of the question.

Use clipboard object to read the values.

Example:

if in Excel we have

1     2                (in some cells)
3     4  
and user copy them to memory.


in vb use this:

Dim v
v = Clipboard.GetText

now v contains  1##2##3##4

use this date and paste it to proper fields in Flexgrid.



buttom line: Your question is like a whole project and you need to work and research to do it.

But all steps are bacially easy and you will learn a lot applying those.


Regards.















0
 
LVL 4

Author Comment

by:CraigLazar
ID: 12074615
hey cool by the pool, thanks a stack\
i am craming this tonight and tomorrow, so i will let u know
thanks again



cheers

Craig
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 12074882
for editing part You need only a textbox

Use this very informational example:

http://www.vb-helper.com/howto_edit_flexgrid_control.html

(forget about previuos link which is supplies by microsoft which happens to be very unstable)
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 12131994
Hi
Sorry for getting back to u on this, I have been really busy on the backend and the database
how do i set the flex grid up so i can simply select a cell and type a value in that cell ?

thanks a stack

Cheers
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 12132444
flex grid itself does not allow you to do this. the trick is to use a textboxand move it to the editing cell.(this
is standard method for doing this)

and again this is very simple , look here for step by step how to do this:


http://www.vb-helper.com/howto_edit_flexgrid_control.html
 
 


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 4

Author Comment

by:CraigLazar
ID: 12133520
Hi
thanks got it going,
say if i have 3 columns, how can i say set the second rows backcolor to blue
so the whole row is bluem i can get just the cell to go blue if i click on it, cause i need to check a variable before loading data into the grid so if row 2 is yes, then its backcolor must be different to row 1 and 3 if that makes any sense ?

thanks again for the help
0
 
LVL 15

Expert Comment

by:unknown_routine
ID: 12133602
I'm not sure what you mean here,

But to change a cell background  do this:( f is name of flexgird)

(change background of cell 2,7 ,flexgrid is zero based)
f.Col = 1
f.Row = 6
f.CellBackColor = vbBlue
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 12133779
u a champ -
Can i grade this question, cause i might need some more help on this as i go along, so can i ask more questions and then add to the points ?

thanks a stack
let me know

cheers
have a great weekend
0
 
LVL 15

Accepted Solution

by:
unknown_routine earned 125 total points
ID: 12133896
I really don't mind answer your questions and I'm not into points (specaily in VB forum).

However forum guideline asks 1 question per thread.

I will be happy to help anyway.
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 12134073
cool thanks - just do not want to take advantage,


have a good one

cheers
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 12158087
morning unkown_routine

Quick question, how easy is it for me to now read teh values out of the cells cause
i then need to update my table in my db with the values in the grid ?

thanks a stack

Cheers
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

708 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

20 Experts available now in Live!

Get 1:1 Help Now