Solved

how to create a grid style entry for entering attendance in VB6

Posted on 2013-12-30
3
500 Views
Last Modified: 2014-01-04
I have a table in sql named Attendance with the following columns:

Agency,StudentID, Student Name, Activity, Hours, Date, Inactive

I would like to make a table in vb6 datagrid which will allow me to enter attendance in this format:

Student       Activity        [1]  [2]  [3]  [4]  [5]   [6]  [7]  etc....  
Sam Jacob    Basketball    3    3     3    3    0     0   0
Bill Johnson Basketball    3    3     3    3    0     0   0  

Then I would like to have the data from this grid input into the table.  How can I accomplish this?  The problem is listing the days of the month in the grid in a manner that will associate with the Date column of my table.

Help please...
0
Comment
Question by:al4629740
3 Comments
 
LVL 12

Assisted Solution

by:pastorchris
pastorchris earned 250 total points
Comment Utility
Oh my God, it's over ten years since I last programmed in VB6 but I will try to help:
The solution should revolve around getting the data from your grid object and firing a procedure per row to manipulate data the way you want it.

For instance, if you're submitting the data, let each row be entered (behind the scenes) as a single row perhaps so that you can manipulate the data as you want.

For example if date is indicated as "3", to mean 3rd December 2013, then let the procedure receive the 3 and then it converts it to the right datetime data to eb kept in that format.
0
 

Author Comment

by:al4629740
Comment Utility
Any example?
0
 
LVL 15

Accepted Solution

by:
JimFive earned 250 total points
Comment Utility
There is not an easy way to do this.  Probably the easiest is to create a table to temporarily hold the display data with fields: Student, Activity, Month, Day1, Day2, Day3, Day4, etc.

Then when the form is loaded (or when a new month/activity is loaded) you run a procedure to load the data into this table.

When the form is saved you run a procedure to update the main table from this temp table.

When the form is closed you need to empty the temp table.

If this is going to be multi-user then you will need to identify the user in the temp table and use some sort of locking flag in the main table to prevent multiple people from editing at the same time.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

728 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

9 Experts available now in Live!

Get 1:1 Help Now