Object Required - Linked Table

Drand

Registered User.
Local time
Tomorrow, 06:04
Joined
Jun 8, 2019
Messages
179
Hi

I have a back end on another computer which in the main works fine. I have however one linked table which I cannot update.

My function is

Code:
Public Function AddToGSTAccount()
Dim dbsPaymentsDue As Database

 Set dbsPaymentsDue = CurrentDb
  Set rstTblPaymentsDue = dbsPaymentsDue.OpenRecordset("TblPaymentsDue")
 
   rstTblPaymentsDue.AddNew
   rstTblPaymentsDue!DateAdded = Now()
   rstTblPaymentsDue!Payee = Forms!FrmAddNewPaymentDue.cboPayee
   rstTblPaymentsDue!Description = Forms!FrmAddNewPaymentDue.cboPaymentFor
   rstTblPaymentsDue!Amount = Forms!FrmAddNewPaymentDue.txtAmount
   rstTblPaymentsDue!DateDue = Forms!FrmAddNewPaymentDue.txtDateDue
   rstTblPaymentsDue.Update
  

 Set rstTblGST = dbsPaymentsDue.OpenRecordset("TblGST")
 
 rst.TblGST.AddNew
 rst.TblGST!TransDate = Date
 rst.TblGST!Deposit = Forms!FrmAddNewPaymentDue.txtAmount
 rst.TblGST.Update
  

End Function

The table "tblPaymentsDue" updates but I get the "object required" error when the code runs to the "tblGST" part.

Any assistance would be appreciated.

Thanks
 
Thank you. It was the dot in rst.tblgst that was the issue. My bad!
 

Users who are viewing this thread

Back
Top Bottom