johndoomed
VBA idiot
- Local time
- Today, 08:57
- Joined
- Nov 4, 2004
- Messages
- 174
Hi, I've searched and read this forum for a couple of hours now, but I cant seem to find the solution on how to add a new record in a subform that does not allow additions.
(I'm using a Norwegian version of Access 2000)
Because I need the subform to not allow additions, I have tried to add a record directly to the table. I found this code on this forum:
I get this errormessage:
(I'm using a Norwegian version of Access 2000)
Because I need the subform to not allow additions, I have tried to add a record directly to the table. I found this code on this forum:
PHP:
Private Sub Kommando13_Click()
On Error GoTo Err_Kommando13_Click
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb()
Set rst = db.OpenRecordset("Oppgave_handling", dbOpenDynaset)
'to add a record
With rst
.AddNew
![Person] = Forms![Hovedmeny]![Person ID].Value
![Oppgave nr] = Forms![Oppgave]![Oppgave nr].Value
.Update
.Close
End With
Err_Kommando13_Click:
MsgBox Err.Description
End Sub
Hope you can help me with this. One of the last pieces of my project...Compile error:
User-defined type not defined