Coba di txttanggal nya itu di format tanggalnya sehingga baris code nya menjadi 

vsql = "select * from t_beli where tanggal = #" & 
format(txttanggal,"mm/dd/yyyy") & "' "

Biasanya berhasil kalau di format tanggalnya. 
Semoga membantu.


  ----- Original Message ----- 
  From: Bodhi 
  To: [email protected] 
  Sent: Wednesday, November 12, 2008 11:25 PM
  Subject: [BinusNet] tanya select untuk tanggal di vb


  Temen2 yg suka bikin program pake VB, nanya dunk, kan g bikin program 
database, 
  trs misalnya ada command

  vsql = "select * from t_beli where tanggal = #" & txttanggal & "' "
  set rcs = dbs.openrecordset (vsql, dbopendynaset)

  vJlm = rcs.recordcount

  kenapa ya hasil recordcount selalu 0, padahal ada datanya ?

  padahal kalau saya pake perintah

  vsql = "select * from t_beli "
  set rcs = dbs.openrecordset (vsql, dbopendynaset)

  if rcs.recordcount > 0 then
  if rcs!tanggal = vtanggal then
  msgbox "ketemu"
  end if
  end if

  hasilnya ketemu, yg berarti ada data ?

  gimana ya select yg bener untuk tanggal ? kalau string kan bisa dipakai kutip 
: '" & vstring & "'

  thx

  [Non-text portions of this message have been removed]



   

PT GLOBAL ERAMAS - APOTIK TEMPO & TEMPO DIRECT
Gedung Bina Mulia 1.Lt.1 - Jl.HR Rasuna Said Kav.X Kuningan
Jakarta Selatan 12950
Ph.021-5201858
Fax.021-5250616

Website : 
- http://www.apotik-tempo.com
- http://www.tempodirect.net

==========================================================
Disclaimer :
This e-mail message may contain legally privileged 
and/or confidential information. If you are not the intended recipient(s), 
or the employee or agent responsible for delivery of this message 
to the intended recipient(s), you are hereby notified that any dissemination,
distribution or copying of this e-mail message is strictly prohibited. 
If you have received this message in error, please immediately 
notify the sender and delete this e-mail message from your computer.
==========================================================



[Non-text portions of this message have been removed]

Kirim email ke