Solved

Grid Control - which will be easier ?

Posted on 2004-09-16
11
243 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
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…
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…

821 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