Can anyone tell me why this event procedure won't work"?
The error is that the Exp1 is an unknown field but this works in the query builder. I need to insert the current date.
Private Sub Comments_AfterUpdate()
Dim db As Database
Set db = CurrentDb
db.Execute "INSERT INTO [Comments] " _
& " SELECT [Assets].[Mylan Asset ID Number], [Assets].[PO Number], Date() AS Expr1,[Assets].Comments FROM [Assets] WHERE " _
& " [Assets].[Mylan Asset ID Number]=" & Me![Mylan Asset ID Number] & ";"
Set db = Nothing
End Sub
Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.
The error is that the Exp1 is an unknown field but this works in the query builder. I need to insert the current date.
Private Sub Comments_AfterUpdate()
Dim db As Database
Set db = CurrentDb
db.Execute "INSERT INTO [Comments] " _
& " SELECT [Assets].[Mylan Asset ID Number], [Assets].[PO Number], Date() AS Expr1,[Assets].Comments FROM [Assets] WHERE " _
& " [Assets].[Mylan Asset ID Number]=" & Me![Mylan Asset ID Number] & ";"
Set db = Nothing
End Sub
Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.