AddNew Method Error 3027

zarcoff

New member
Local time
Today, 09:15
Joined
Oct 29, 2014
Messages
5
Hi All,

Thank you for any help in advance. This is doing my head in. It was working yesterday but today it is not. I am using VBA to add a new record to a linked table. The steps I have taken so far are:

Copy the DB to my C drive.
Unlink the network DB and relink all the tables to the local DB (have read this is error is due to rights)

I have converted it to a local table and it updates but I need to update it in the back end. I have a form that opens this form and that uses the same method and works (linked to a different table in the same back end db)



Code:
Code:
dim db as DAO.Database
dim rs as DAO.Recordset

Set db = CurrentDb

Set rs = db.OpenRecordset("tblDeviceOrderDetails")

rs.AddNew

    rs![DeploymentSlotID] = 11 'CLng(Me.lblDeploymentSlotID.Caption)
    rs![Group] = Me.txtGroup
    rs![UserID] = Me.cbxUserID
    rs![Count] = Me.txtCount
    rs![Product Type] = Me.cbxProductType
    rs![Product] = Me.cbxProductOrAccessory
    rs![OS] = Me.cbxOS
    
    rs![AMG01] = Me.chkAMG01
    rs![AMG02] = Me.chkAMG02
    rs![AMG03] = Me.chkAMG03
    rs![AMG04] = Me.chkAMG04
    rs![AMG05] = Me.chkAMG05
    rs![AMG06] = Me.chkAMG06
    rs![AMG07] = Me.chkAMG07
    rs![AMG08] = Me.chkAMG08
    rs![AMG09] = Me.chkAMG09
    rs![AMG10] = Me.chkAMG10
    
rs.Update


Any ideas? :banghead:

Zar!
 
make sure the table is not opened in Design mode.
this will prevent updating.
 
Can only open a local table otherwize try this

Set rs = db.OpenRecordset("Select * from tblDeviceOrderDetails")
 
Hi Smig and Namlian,

The userform had a subform in the footer. I have just removed it and it has started working. Thank you so much for responding. So I know what is kind of going on and I will try and work it out from there. Apologies for such a school boy error... but thank you very much for your help.
 

Users who are viewing this thread

Back
Top Bottom