Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 522
  • Last Modified:

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

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
al4629740
Asked:
al4629740
2 Solutions
 
Chris MConsulting - Technology ServicesCommented:
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
 
al4629740Author Commented:
Any example?
0
 
JimFiveCommented:
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

Technology Partners: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now