S
Stella Pieters via AccessMonster.com
L.S.
I've been trying to make this code work without any succes.
I've a transaction table where I store all the records of sold items.
Ive used the following code, but I keep on receiving "Run-time error 2465",
Microsoft Office Access can't find the field "|" referred to in your
expression.
Private Sub Form_AfterUpdate()
'If Me.NewRecord Then
Dim rst As DAO.Recordset
Dim dbs As DAO.Database
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Transaction Table", dbOpenTable)
If Me![Owndepomys] = False Then
[Transaction Table.Storeroom] = "FP02"
[Transaction table.TransactionDate] = Me![Datevisit]
[Transaction table.Artcode] = DLookup("[ArtCode]", "Contraceptives",
"[Description]=" & Forms![visits]!Description)
[Transaction table.TransactionDescription] = "Over the counter"
[Transaction table.UnitsSold] = Me![Qty]
[Transaction table.AmountQty] = [Transaction table.AmountQty] * Me!
[Contraceptives.Price]
rst.AddNew
End If
'End If
'err_Form_AFterUpdate:
Exit Sub
End Sub
I've posted this problem yesterday but did not receive any response. Could
you please help with this.
By the way I'm a newbie in VBA coding.
Thank you in advance.
Stella Pieters
I've been trying to make this code work without any succes.
I've a transaction table where I store all the records of sold items.
Ive used the following code, but I keep on receiving "Run-time error 2465",
Microsoft Office Access can't find the field "|" referred to in your
expression.
Private Sub Form_AfterUpdate()
'If Me.NewRecord Then
Dim rst As DAO.Recordset
Dim dbs As DAO.Database
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("Transaction Table", dbOpenTable)
If Me![Owndepomys] = False Then
[Transaction Table.Storeroom] = "FP02"
[Transaction table.TransactionDate] = Me![Datevisit]
[Transaction table.Artcode] = DLookup("[ArtCode]", "Contraceptives",
"[Description]=" & Forms![visits]!Description)
[Transaction table.TransactionDescription] = "Over the counter"
[Transaction table.UnitsSold] = Me![Qty]
[Transaction table.AmountQty] = [Transaction table.AmountQty] * Me!
[Contraceptives.Price]
rst.AddNew
End If
'End If
'err_Form_AFterUpdate:
Exit Sub
End Sub
I've posted this problem yesterday but did not receive any response. Could
you please help with this.
By the way I'm a newbie in VBA coding.
Thank you in advance.
Stella Pieters