It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Problem with date

Moderator: dafunkymunky

Problem with date

Postby imagetvr on Sun Nov 18, 2007 3:31 pm

Hello

I have one visual basic date problem

I am deleloping one simple programme. I need using query to fetch record

Table name : Collection (Access Table)

Fields Data Type


Transid Autonumber
Lno Text
Day Number
Cname Text
Date Date/Time format =(short format)
amt_received number


Now i need a query to tech record using date and lno

In programme i use following coding

In form in using date picker to check value (date format in date picket 16/11/07)

date/month/year

one text box to get lno



Private Sub txtlno_LostFocus()
Set rs4 = New ADODB.Recordset
sql = "select * from collection where date = " & dtpdate.value & " and lno ='" & txtlno.text &

"' "
rs4.Open sql, CN, adOpenStatic, adLockPessimistic

If rs4.RecordCount > 0 Then

sdate = rs4(4).Value
MsgBox ("This Loan Number Already entered")
txtlno.SetFocus
End If

End Sub

the above coding not working because of date value not working well please help to fetch records

using above query
imagetvr
 
Posts: 3
Joined: Sun Feb 18, 2007 5:30 am

Postby zul111467 on Sat Jan 19, 2008 8:05 pm

Please try to modify your sql command string as below. Good Luck!


sql = "select * from collection where date = #" & dtpdate.value & "# and lno ='" & txtlno.text
zul111467
 
Posts: 6
Joined: Sat Jan 19, 2008 3:54 pm
Location: Malaysia


Who is online

Users browsing this forum: No registered users and 0 guests