my class project. i'm confused about: - insert data avoid data duplicate (in database & mshflexgrid) join table auto number primary key that not used can be insert/updateable - insert, update & delete not showing / refresh automatically to mshflexgrid
I put this code to button_event: PHP: 01 On Error GoTo ErrT02 If mValidateControl.Validate(txtKode0, txtKode0.Text <> "") = True Then03 MsgBox "Kode Bahasa belum diisi"04 Else05 Rs.MoveFirst06 If Not (Rs.EOF = True And Rs.EOF = True) Then07 While Not Rs.EOF08 If Rs("kdBhs") = txtKode0.Text Then09 MsgBox "data sudah ada"10 Else11 Rs.AddNew12 Rs("kdBhs") = txtKode0.Text13 Rs("jnsBhs") = txtJenis2.Text14 Rs("nmBhs") = txtNama3.Text15 Rs.Update16 ' sql = "Insert Into Bahasa"17 ' Cmd.CommandText = sql18 ' Cmd.Execute19 End If20 Rs.MoveNext21 Wend22 End If23 End If24 ' Rs.Requery25 ' Rs.UpdateBatch26 'MSHFlexGrid1.Redraw = True27 'MSHFlexGrid1.Refresh28 Call FillFromRecordset_FlexGrid(MSHFlexGrid1, Rs, False)29 ErrT:30 ' If Err = 2147467259 Then31 ' 'this will simply ignore the error and exit the routine32 ' Exit Sub33 ' Else34 ' 'this will display the error message for any other error that occurred35 MsgBox "Data Sudah ada"36 SelectTextFocus txtKode037 ' Exit Sub38 ' End If why every update database, flexgrid not show the last result from last updated database?