Option ExplicitProblem med VB! Den updaterar sig inte...
Dim rsService As Recordset
Dim rsNyService As Recordset
Private Sub cmdSpara_Click()
Set rsNyService = db1.OpenRecordset("Service", dbOpenDynaset)
rsNyService.AddNew
rsNyService("ServiceDatum") = Me.txtDatum.Text
rsNyService("Antalreservdelar") = Me.txtAntal.Text = "0"
rsNyService("Serviceåtgärd") = Me.txtService.Text
rsNyService("Regnr") = strRegnr
rsNyService.Update
txtDatum.Text = ""
txtAntal.Text = ""
txtService.Text = ""
lstDatum.Clear
lstAntal.Clear
lstService.Clear
Call Form_Load
End Sub
Private Sub cmdTillbaka_Click()
frmService.Hide
frmStart.Show
End Sub
Private Sub Form_Load()
lblRegnr.Caption = strRegnr
Dim qrService As QueryDef
Set qrService = db1.QueryDefs("Service1")
qrService.Parameters("pService") = strRegnr
Set rsService = qrService.OpenRecordset()
Do Until rsService.EOF
lstDatum.AddItem rsService("ServiceDatum")
lstAntal.AddItem rsService("Antalreservdelar")
lstService.AddItem rsService("Serviceåtgärd")
rsService.MoveNext
Loop
End Sub