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
Solved

Grid Control - which will be easier ?

Posted on 2004-09-16
11
250 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

808 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