Click here to Skip to main content
15,949,686 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Developing a Restaurant Billing System Pin
David Mujica11-Mar-20 10:53
David Mujica11-Mar-20 10:53 
GeneralRe: Developing a Restaurant Billing System Pin
Meax12-Mar-20 0:43
Meax12-Mar-20 0:43 
GeneralRe: Developing a Restaurant Billing System Pin
Gerry Schmitz15-Mar-20 7:21
mveGerry Schmitz15-Mar-20 7:21 
Questionfile attributes Pin
johnruben9-Mar-20 11:13
johnruben9-Mar-20 11:13 
AnswerRe: file attributes Pin
Mycroft Holmes9-Mar-20 11:41
professionalMycroft Holmes9-Mar-20 11:41 
AnswerRe: file attributes Pin
Richard MacCutchan9-Mar-20 22:27
mveRichard MacCutchan9-Mar-20 22:27 
QuestionCopying pictures of desktop icons to a WORD file Pin
Member 124319885-Mar-20 3:35
Member 124319885-Mar-20 3:35 
AnswerRe: Copying pictures of desktop icons to a WORD file Pin
Eddy Vluggen5-Mar-20 23:53
professionalEddy Vluggen5-Mar-20 23:53 
QuestionIs VB.Net under-rated? Pin
Chris Nic28-Feb-20 0:07
Chris Nic28-Feb-20 0:07 
AnswerRe: Is VB.Net under-rated? Pin
Dave Kreskowiak28-Feb-20 5:22
mveDave Kreskowiak28-Feb-20 5:22 
GeneralRe: Is VB.Net under-rated? Pin
ZurdoDev28-Feb-20 6:46
professionalZurdoDev28-Feb-20 6:46 
AnswerRe: Is VB.Net under-rated? Pin
Eddy Vluggen28-Feb-20 6:06
professionalEddy Vluggen28-Feb-20 6:06 
AnswerRe: Is VB.Net under-rated? Pin
ZurdoDev28-Feb-20 6:50
professionalZurdoDev28-Feb-20 6:50 
GeneralRe: Is VB.Net under-rated? Pin
Eddy Vluggen28-Feb-20 9:52
professionalEddy Vluggen28-Feb-20 9:52 
GeneralRe: Is VB.Net under-rated? Pin
ZurdoDev28-Feb-20 10:01
professionalZurdoDev28-Feb-20 10:01 
GeneralRe: Is VB.Net under-rated? Pin
Eddy Vluggen28-Feb-20 10:29
professionalEddy Vluggen28-Feb-20 10:29 
GeneralRe: Is VB.Net under-rated? Pin
jsc4211-Apr-20 9:26
professionaljsc4211-Apr-20 9:26 
GeneralRe: Is VB.Net under-rated? Pin
markrlondon13-Apr-20 11:27
markrlondon13-Apr-20 11:27 
AnswerRe: Is VB.Net under-rated? Pin
Mycroft Holmes28-Feb-20 11:22
professionalMycroft Holmes28-Feb-20 11:22 
GeneralRe: Is VB.Net under-rated? Pin
markrlondon13-Apr-20 11:28
markrlondon13-Apr-20 11:28 
QuestionVB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 2:39
Member 1186689325-Feb-20 2:39 
When I save the attendance date from a datetimepicker as a date prior to today's date it records acceptable format but not what I really want. When I select today's date it records a date like this 2020-02-25 08:28:00.946341400.

The secondary issue is what I eluded to above. I set the custom format in the form_load to "MM, dd, yyyy" and when I select a date prior to today's date it records the date like this 2020-01-29 08:34:25.

Here is the Save Button code

Dim inserted As Integer = 0
       For Each row As DataGridViewRow In dgvAttend.Rows
           Dim isSelected As Boolean = Convert.ToBoolean(row.Cells("chkbox").Value)
           If isSelected Then
               Access.AddParam("@DTE", dtPick5.Value)
               Access.AddParam("@SID", row.Cells("StudentID").Value)
               Access.AddParam("@LN", row.Cells("LastName").Value)
               Access.AddParam("@FN", row.Cells("FirstName").Value)

               Access.ExecQuery("INSERT INTO Attend (TrainDate,StudentID,LastName,FirstName) " &
                        "VALUES (@DTE,@SID,@LN,@FN); ")

               inserted = inserted + 1
           End If
       Next

       If inserted > 0 Then
           MessageBox.Show(String.Format("{0} records inserted.", inserted), "ACJTracker", MessageBoxButtons.OK, MessageBoxIcon.Information)
       End If


Here is the form load

dtPick5.Format = DateTimePickerFormat.Custom
        dtPick5.CustomFormat = "MM, dd, yyyy"
        RefreshAttendGrid()


Here is the refresh Grid

dtPick5.Format = DateTimePickerFormat.Custom
       dtPick5.CustomFormat = "MM, dd, yyyy"

       ' RUN QUERY
       Access.ExecQuery("SELECT StudentData.StudentID, StudentData.LastName, StudentData.FirstName FROM StudentData ORDER BY StudentID ASC")

       ' REPORT & ABORT ON ERRORS
       If NoErrors(True) = False Then Exit Sub

       dgvAttend.DataSource = Access.DBDT


Does anyone know how I correct these issues?
AnswerRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 3:07
mveRichard MacCutchan25-Feb-20 3:07 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 3:18
Member 1186689325-Feb-20 3:18 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Richard MacCutchan25-Feb-20 3:33
mveRichard MacCutchan25-Feb-20 3:33 
GeneralRe: VB.NET/MS ACCESS Saving today's date produces 2020-02-25 08:28:00.946341400 Pin
Member 1186689325-Feb-20 3:32
Member 1186689325-Feb-20 3:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.