Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 25th, 2009, 01:57 PM
Authorized User
 
Join Date: Jan 2009
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
Default how to set datafield of recordset as column name of flex grid

Dear reader (s),

In my AccessDB, JanuaryDay(Table) having two columns JanDate & JanShift. JanDate contains all the dates of each month and JanShift contains text value for each date. Its like:

Id....... JanDate..........JanShift
1..........1/1/09..............SM
2..........1/2/09.............. M

........................................
........................................

31.......1/31/09..............M

I Can retrieve the recordset for a specific month which I want to display in MsFLGrid. I Want the JanDate value as column name of MsFLGrid and JanShift will display in next row of MsFLGrid. Output will be:

1/1/09..1/2/09.................1/31/09
SM........ M.......................M

Can any one please help me with some sample VB6.o code???

Regards
 
Old February 25th, 2009, 02:04 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi there.. can you please explain why you want to do that???? a date is not a collum name unless you fill it with relevant data. why the user don't want to see the data in the correct way???

and maybe, maybe, the grid is not what you need. what are you looking to show for the user?? is there any interaction??

I ask you because this can be done.. but is a real pain in the ***.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old February 26th, 2009, 06:58 PM
Authorized User
 
Join Date: Jan 2009
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
Default how to set datafield of recordset as column name of flex grid

Dear gbianchi,

Thanks for the reply. I tried to attach my AccessDB here but could not find option. Thats what i mailed (to [email protected] found in your profile) you AccessDB and my plan.

I'M REALLY SORRY FOR MAILING WITHOUT YOUR PERMISSION. FOR THE LAST FEW DAYS I'M HITTING MY HEAD AGAINST WALL WITH THIS PROBLEM.

Please Please and Please.........

Help me...
 
Old February 26th, 2009, 10:20 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Ok, I receive it, but I really don't know what to do with it...

I will copy your mail here. The forum is for something, other people who needs helps can look for it here. It we keep it private, then the only beneficiary is you. And we usually help people, but we don't do they works (AND WE NEVER DO HOMEWORK, not your case, but if somebody else read).

Quote:
here i have attached my AccessDB. I'm developing a roster mangement tool. In table JanuaryDay, u could find dates and shift for individual agents. In VB6.0 i kept two dtPicker controls, one is for selecting FROM date and another is for TO date. After selecting from and to date when user click cmdbutton data will be presented in flex grid control.
the way i planed is:

Name(from table "users") and all the dates (from dtpicker1 to dtpicker2, *not more then a month) will be the column name of flex grid. In row, name(from table "users") and JanShift(Shift name from table "JanuaryDay") value will display with respect to name(from table "users"). Finally user can see the shift wise manpower of the specific date or a specific date range.

Its true that i'm not a good programmer. I'm not sure that things i asked above with flex grid is possible or not. if possible then please help me with code or if not then can u please give me any solution or any other control suits my plan better?

Honestly, i'm hitting head against wall for the last few days. but cannot make it done. As i told you earlier...........

Kids need appreciation and guide. In programming world Iʼm a kid and highly eager to learn programming.

With regadrs,
devilz
I didn't open your database.

your want to present your data is something like this???

blank user1 user2 user3 ... userNN
date1 shift shift shift ...
date2 shift shift shift ...
date3 shift shift shift ...

or inverted. is the same... well.. the flex doesn't have first collum as title (or I don't remember), so the first collum will just look like a common value.

I don't remember by heart the code to do that. The query is a simple select that joins the table.

I can do the query for you (not now, tomorrow), but the code in the flexy is heavy. But if you probably google about it you will find nice ideas.

Anyway, try to start with it, and I will help you all I can.

another question. this is only for presentation or you also need to let the user change the data in any way?
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========
 
Old February 26th, 2009, 11:00 PM
Authorized User
 
Join Date: Jan 2009
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Its just like regardless the first column:

Name date1 date2 date3 ... userNN
user1 shift shift shift ...
user2 shift shift shift ...
user3 shift shift shift ...

Can you do the SQL quary for me?
Will it retrieve data as above mentioned way?

If so then i'll set it in ADO recordset and will be able to represent by MsHFlexGrid.

Its just a presentation of data.

Thank you very much,

regards
 
Old February 28th, 2009, 01:34 PM
Authorized User
 
Join Date: Jan 2009
Posts: 20
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Hello gbianchi

Waiting for your reply.......

Regards,
 
Old February 28th, 2009, 03:47 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Hi...

I couldn't download the database, hotmail blocked the file.

Anyway, the query is simple (and the access asistant would do it for you in a few seconds).

Code:
 SELECT NAME, SHIFT,DATE FROM nametable innerjoin shifttable on nametable.id = shifttable.nameid where month(date) = themonthyouneed
try something like that. And use access, it's better to learn by yourself and ask why your logic is bad that stand still waiting for the solution.
__________________
HTH

Gonzalo


================================================== =========
Read this if you want to know how to get a correct reply for your question.
(Took that from Doug signature and he Took that from Peter profile)
================================================== =========
My programs achieved a new certification :
WORKS ON MY MACHINE
================================================== =========
I know that CVS was evil, and now i got the
proof.
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
set font for grid column header suji Visual Studio 2005 0 June 12th, 2008 07:40 AM
VS Flex Grid Version 7 abdulqadirpk VB Components 0 December 27th, 2006 07:16 AM
flex grid [email protected] General .NET 0 January 12th, 2006 01:18 AM
flex grid entry jady VB Databases Basics 1 September 29th, 2004 11:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.