PC Review


Reply
Thread Tools Rate Thread

Addnew throwing error 3027

 
 
ScottInTexas
Guest
Posts: n/a
 
      11th Feb 2010
In one sub I am trying to add a record to to "Abstracts" table. Records in
the abstracts table are related to the States and counties tables. So I open
a recordset with joins. I have tried several times after checking everything
out and cannot find any reason why the recordset should be read only. I have
also checked for a lock file (as suggested in another post).

The code:

Private Sub cmdSave_Click()
Dim strSQL As String
Dim rs As DAO.Recordset
Dim db As DAO.Database

If blnCheckFields Then
'save new abstract
Set db = CurrentDb()
strSQL = "SELECT Abstracts.StateID As AStateID, Abstracts.CountyID
AS ACountyID, Abstracts.FileNo, " & _
"Abstracts.OriginalGrantee, Abstracts.Patentee, " & _
"Abstracts.PatentDate, Abstracts.PatentNumber,
Abstracts.PatentVol, Abstracts.Certificate, Abstracts.Section, " & _
"Abstracts.Acreage, Abstracts.AbstractName,
Abstracts.AbstractNo, County.CountyID, States.StateID" & _
" FROM States INNER JOIN (County INNER JOIN Abstracts ON
County.CountyID = Abstracts.CountyID) " & _
"ON (Abstracts.StateID = States.StateID) AND (States.StateID
= County.StateID) " & _
"WHERE (((County.CountyID)=" & cboCounty & ") AND
((States.StateID)=" & cboState & "));"

Set rs = db.OpenRecordset(strSQL, dbOpenDynaset)
rs.FindFirst "AbstractNo" = txtAbstractNo
If rs.NoMatch Then
rs.AddNew
Else
rs.Edit
End If
With Me
rs!ACountyID = .cboCounty
rs!AStateID = cboState
rs!FileNo = .txtFileNo
rs!OriginalGrantee = .txtGrantee
rs!Patentee = .txtPatentee
rs!Patentdate = .txtDate
rs!PatentNumber = .txtPatentNo
rs!PatentVol = .txtVol
rs!Certificate = .txtCert
rs!Section = .txtSection
rs!Acreage = .txtAcreage
rs.Update
End With
ClearFields
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Else
'cancelout and leave routine
MsgBox "Missing Required Data", vbOKOnly
End If

End Sub

This routine is found in the form "frmAbstracts" and there is nothing else
open or running at the time. I have done it this way since the beginning of
time. Can't figure out what is going on.

Access 2007, Windows XP Professional, Dell Vostro 1510

Thanks for your help.

Scott
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 3027 Toxalot Microsoft Access 9 29th Sep 2008 07:44 AM
Error 3027 Nuno Gomes Microsoft Access Queries 2 12th Aug 2008 12:24 PM
Error 3027 Nuno Gomes Microsoft Access Forms 1 11th Aug 2008 10:22 AM
Error 3027... =?Utf-8?B?UmF1bCBTYW5kb3ZhbA==?= Microsoft Access External Data 2 31st Dec 2004 04:49 PM
error 3027 Merco Microsoft Access External Data 0 19th Oct 2004 03:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:02 AM.