G
Guest
Why doesn´t something happen when I run this script?
Private Sub Kommandoknapp90_Click()
On Error GoTo Err_Kommandoknapp90_Click
DoCmd.OpenReport "beställning", acViewPreview
Dim mydb As Database
Dim rst As DAO.Recordset
Set mydb = CurrentDb()
Set rst = mydb.OpenRecordset("SELECT Korddata.*, Korddata.[skriv ut]
FROM Korddata WHERE Korddata.[skriv ut]=Yes);")
rst.MoveFirst
Do Until rst.EOF = True
rst![Levererad] = no
rst![Histdat] = Now()
rst![skriv ut] = yes
rst.Update
rst.MoveNext
Loop
Set rst = Nothing
Set mydb = Nothing
Exit_Kommandoknapp90_Click:
Exit Sub
Err_Kommandoknapp90_Click:
Exit Sub
Resume Exit_Kommandoknapp90_Click
End Sub
Private Sub Kommandoknapp90_Click()
On Error GoTo Err_Kommandoknapp90_Click
DoCmd.OpenReport "beställning", acViewPreview
Dim mydb As Database
Dim rst As DAO.Recordset
Set mydb = CurrentDb()
Set rst = mydb.OpenRecordset("SELECT Korddata.*, Korddata.[skriv ut]
FROM Korddata WHERE Korddata.[skriv ut]=Yes);")
rst.MoveFirst
Do Until rst.EOF = True
rst![Levererad] = no
rst![Histdat] = Now()
rst![skriv ut] = yes
rst.Update
rst.MoveNext
Loop
Set rst = Nothing
Set mydb = Nothing
Exit_Kommandoknapp90_Click:
Exit Sub
Err_Kommandoknapp90_Click:
Exit Sub
Resume Exit_Kommandoknapp90_Click
End Sub