Solved

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

Posted on 2013-12-30
3
511 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
[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
3 Comments
 
LVL 12

Assisted Solution

by:pastorchris
pastorchris earned 250 total points
ID: 39747755
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
ID: 39748164
Any example?
0
 
LVL 15

Accepted Solution

by:
JimFive earned 250 total points
ID: 39748183
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

732 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