Happy New Year to all,
I have a winform with 7 tabs (Tab Control) 6 of them have a datagrid with different information. The 7th tab has all the datagrid on it.
I need to enter a date on the 7th tab that will retrieve all information from that date for each grid button click. The Access database has 6 tables, the code is as simple as it gets to store information.

- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Shift_End_Report
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- // TODO: This line of code loads data into the 'shift_End_Report_3DataSet.Restriction_Accommodation' table. You can move, or remove it, as needed.
- this.restriction_AccommodationTableAdapter.Fill(this.shift_End_Report_3DataSet.Restriction_Accommodation);
- // TODO: This line of code loads data into the 'shift_End_Report_3DataSet.Open_Part_Issues' table. You can move, or remove it, as needed.
- this.open_Part_IssuesTableAdapter.Fill(this.shift_End_Report_3DataSet.Open_Part_Issues);
- // TODO: This line of code loads data into the 'shift_End_Report_3DataSet.SSAR' table. You can move, or remove it, as needed.
- this.sSARTableAdapter.Fill(this.shift_End_Report_3DataSet.SSAR);
- // TODO: This line of code loads data into the 'shift_End_Report_3DataSet.Hot_Calls' table. You can move, or remove it, as needed.
- this.hot_CallsTableAdapter.Fill(this.shift_End_Report_3DataSet.Hot_Calls);
- // TODO: This line of code loads data into the 'shift_End_Report_3DataSet.Attendance' table. You can move, or remove it, as needed.
- this.attendanceTableAdapter.Fill(this.shift_End_Report_3DataSet.Attendance);
- // TODO: This line of code loads data into the 'shift_End_Report_3DataSet.Part_Shortage' table. You can move, or remove it, as needed.
- this.part_ShortageTableAdapter.Fill(this.shift_End_Report_3DataSet.Part_Shortage);
- }
- #region Part Shortage Buttons
- private void btn_PS_Add_Click(object sender, EventArgs e)
- {
- this.partShortageBindingSource.AddNew();
- }
- private void btn_PS_Save_Click(object sender, EventArgs e)
- {
- this.Validate();
- this.partShortageBindingSource.EndEdit();
- this.part_ShortageTableAdapter.Update(this.shift_End_Report_3DataSet);
- this.part_ShortageTableAdapter.Fill(this.shift_End_Report_3DataSet.Part_Shortage);
- }
- private void btn_PS_Next_Click(object sender, EventArgs e)
- {
- this.partShortageBindingSource.MoveNext();
- }
- private void btn_PS_Previous_Click(object sender, EventArgs e)
- {
- this.partShortageBindingSource.MovePrevious();
- }
- private void btn_PS_Delete_Click(object sender, EventArgs e)
- {
- this.partShortageBindingSource.RemoveCurrent();
- }
- private void btn_PS_Exit_Click(object sender, EventArgs e)
- {
- var result = MessageBox.Show("Are you sure you would like to exit?", "Closing Program",
- MessageBoxButtons.YesNo, MessageBoxIcon.Question);
- if (result == DialogResult.Yes)
- {
- Application.Exit();
- }
- #endregion
- }
- #region Attendance Buttons
- #endregion
- #region Hot Sheet Button
- #endregion
- }
- #region SSAR Buttons
- #endregion
- }
- #region Open Part Button
- #endregion
- }
- #region Restriction Buttons
- #endregion
- }
- private void btn_Date_Click(object sender, EventArgs e)
- {
- }
- }
- }
Laxmidhar SahooPosted Jan 2, 2018, 2:08 AM