If rs1.RecordCount <> 0
Then
rs1.MoveLast
rs1.MoveFirst
For j = 1 To
rs1.RecordCount
cmbtgl.AddItem "select Tgl from tblJoin1 where Tgl= '" &
txtcarinomr. Text & "'", cnJoin, adOpenStatic,
adLockOptimistic
rs1.MoveNext
Next j
End If
Maksud programnya, bagaimana supaya combo tanggal menampilkan tanggal
sesuai NoMR.
-------------------------------------
Coba kode ini:
call AddItemToCombo
sub cmd_click
end sub
sub AddItemToCombo
sSQL = "select Tgl from tblJoin1 where Tgl= '" &
txtcarinomr. Text & "'"
cmbtgl.AddItem getReadOnlyRS(sSQL).fields(0)
end sub
Function getReadOnlyRS(sSQL) As ADODB.Recordset
Dim oConnTemp As New ADODB.Connection
Dim rsTemp As ADODB.Recordset
Set rsTemp = New ADODB.Recordset
'MsgBox sSQL
oConnTemp.open sConnODBC
rsTemp.open sSQL, oConnTemp, adOpenStatic
If Not rsTemp.EOF Then
Set getReadOnlyRS = rsTemp
Else
Set getReadOnlyRS = Nothing
End If
Set oConnTemp = Nothing
End Function
------------------
http://xbasicpro.brinkster.net
----- Original Message ----
From: Taufiqurrahman <[EMAIL PROTECTED]>
To: [email protected]
Cc: Toni Rahayu <[EMAIL PROTECTED]>
Sent: Tuesday, January 29, 2008 12:53:46 PM
Subject: [Programmer-VB] input combo box
Boleh nanya gak,
If rs1.RecordCount <> 0
Then
rs1.MoveLast
rs1.MoveFirst
For j = 1 To
rs1.RecordCount
cmbtgl.AddItem "select Tgl from tblJoin1 where Tgl= '" &
txtcarinomr. Text & "'", cnJoin, adOpenStatic,
adLockOptimistic
rs1.MoveNext
Next j
End If
Maksud programnya, bagaimana supaya combo tanggal menampilkan tanggal
sesuai NoMR.
Mohon koreksinya