?
Solved

Grid Control - which will be easier ?

Posted on 2004-09-16
11
Medium Priority
?
265 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
[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
  • 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
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!

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

Industry Leaders: 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

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 …
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month14 days, 7 hours left to enroll

771 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