I'm so newbie. Badly need ur help. on a form i put a combobox retrieved from a different table. it works fine. but when i filled in all the entries and saved them, it didn't save. still empty. before is used the combo, it was just fine.
here's the script ( a little), for a start. btw, it's vb6.
Here's the save script:Code:Private Sub Form_load() Set wjt = CreateWorkspace("", "admin", "", dbUseJet) Set a = wjt.OpenDatabase("D:\My Documents\VB_Practice\db1.mdb") Set a = OpenDatabase("D:\My Documents\VB_Practice\db1.mdb") Set b = a.OpenRecordset("student") Set f = a.OpenRecordset("select distinct (class) from rombel") cboclass.Text = f!class With cboclass .Clear On Error Resume Next If f.RecordCount = 0 Then MsgBox "type in data", vbOKOnly Else f.MoveFirst Do Until f.EOF .AddItem f(0) f.MoveNext Loop End If End With Return If b.RecordCount = 0 Then Call empty Else b.MoveFirst End If change= False End Sub
after clicking save, and click the next button, it show "no current record" [runtime error '3021']Code:Private Sub save_Click() b.AddNew b!no = tno.Text b!nisn = tnisn.Text b!class = cboclass.Text b!name = tname.Text b!sex= tsex.Text b.Update Call empty tno.SetFocus End Sub
i assumed it's bcoz of the combobox which is probably not properly set.
any idea? please.
tx b4




Reply With Quote