VB Code:
Sub Save1() Dim msql As String Dim rsTmp As ADODB.Recordset msql = "insert into tbnotajual(tanggal)values('" & dptanggal & "')" con_data.Execute msql msql = "select * from tbnotajual" & _ "where nonota in (select max(NoNota) from tbnotajual)" Set rsTmp = con_data.Execute(msql) If Not (rsTmp Is Nothing) Then If (Not rsTmp.BOF) And (Not rsTmp.EOF) Then txtnota.Text = rsTmp.Fields("NoNota").Value End If rsTmp.Close End If 'rs.Requery 'why are you requerying this recordset? what is its query? txtkodebarang.SetFocus End Sub




Reply With Quote