Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

VB 6 Input Date format

$
0
0
Hi

I have a Date textfield, that describes to the user the format of the date (YYYY/MM) then I would use that date on my WHERE clause to update database. my Date in the database is also in the same format (YYYY/MM).

I need to write a code that will validate first if the input date is in the correct format before I can apply it on my WHERE clause. I have this code below, I need to extend it to cater for newly date column.

please help

If Len(txtSalary.Text) = 0 Or Len(txtmCover.Text) = 0 Or Len(txtMember.Text) = 0 Or Len(txtmRate.Text) = 0 Or Len(txtDate.Text) = 0 Then

MsgBox "Enter All The Fields Values"

Else
tsql = "UPDATE Hpacc4 SET SalaryBill = '" & txtSalary.Text & "', Rate = '" & txtmRate.Text & "', RateType = '" & comboRate.Text & "', Membership = '" & txtMember.Text & "', Cover = ' " & txtmCover & " ' Where Scheme = ' " & txtSCode & " ' AND RunMonth = ' " & txtDate & " ' AND AccCode = '110'"
MsgBox "Updated"

cnHPtest.Execute (tsql)

End If

Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>