Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Memo field -- Error 3188, using Access 2007

Status
Not open for further replies.

lmcc007

Technical User
May 7, 2009
164
US
Error 3188:

I have an EventNote table with three fields:
1) EventNoteID - AutoNumber
2) EventID - Number
3) EventNoteData – Memo

The EventDetail form has a button to click to add notes, which will open to EventNoteData field. I found out if you are adding data over 2K it will not save or let you delete the data or revise the data and you get the Error 3188.

I’ve been searching this past week and found out this is a known problem with Memo fields.

Has anyone by now found a solution?
 
Maybe, I am not sure of your specific question because the opening and closing should be pretty basic,
'close current form
docmd.close acform, me.name
'open the next.
docmd.openform "yourPopUp".....acdialog

You can not switch the above order because if you did the pop up open in dialog would stop code execution in the calling form and it would not close unitl after you close the pop up.

By passing the pop up openargs you can tell it on its close to reopen the calling form to the specified record.
 
So, you're saying instead of saying Docmd.openform... you say OpenArg?

I'm off--I better leave this one alone. I'm just sick of this db--after all the hard work of creating the forms and stuff--this one problem appears. When I recreated the forms from scratch the same thing--every thing is okay until you open the Note form from the other form.

My head is spinning.
 
Hey MajP,

I think I may have found the problem. During my many many tests I discovered that my second form frmViewEventHistory when opened I get the following error:

Could not update; currently locked by another session on this machine. (Error 3188)

You tried to update information that is currently locked by another session. Wait for the other session to finish or close the other session, and then try the operation again.

So, I decided to close frmViewEventHistory after opening fdlgEventDetailEdit and now I am able to add, edit, and delete when I open EventNote. So, four forms deep I get the Error--meaning:

1) fmainCompany form click to open
2) frmViewEventHistory form and from this list I click to open
3) fdlgEventDetailEdit form and from here I click to add or edit
4) EventNote
 
I am not sure if everything is good, or you still have a question. Is there any code that references the form's recordset?
 
MajP,

I created the form from scratch again and tested it first before entering any code--worked fine. After I entered the code then I get the Error 3188. It seems to be just this form. I looked at the code over and over again and do not see anything wrong. Below is all the code in frmViewEventHistory form:


Option Compare Database
Option Explicit

Private Sub cmdClose_Click()

On Error GoTo ErrorHandler

DoCmd.Close acForm, "frmViewEventHistory"


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub cmdEditDelete_Click()

On Error GoTo ErrorHandler

If Me!ActivityID = 11 Or Me!ActivityID = 12 Or Me!ActivityID = 13 Or Me!ActivityID = 14 Then
DoCmd.OpenForm "fdlgEventDetailEdit", , , "[EventID] = " & Me!txtEventID
DoCmd.OpenForm "fdlgMeetingFor", , , "[EventID] = " & Me!txtEventID
Else
DoCmd.OpenForm "fdlgEventDetailEdit", , , "[EventID] = " & Me!txtEventID
End If


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub Detail_DblClick(Cancel As Integer)

On Error GoTo ErrorHandler

If Me!ActivityID = 11 Or Me!ActivityID = 12 Or Me!ActivityID = 13 Or Me!ActivityID = 14 Then
DoCmd.OpenForm "fdlgEventDetailEdit", , , "[EventID] = " & Me!txtEventID
DoCmd.OpenForm "fdlgMeeting", , , "[EventID] = " & Me!txtEventID
Else
DoCmd.OpenForm "fdlgEventDetailEdit", , , "[EventID] = " & Me!txtEventID
End If


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub Form_Current()

On Error GoTo ErrorHandler

Me!txtCaption = "History of Events Thru " & Me!txtEndDate & " for " & _
IIf(Me!txtCompanyName = "", "Company ID " & Me!txtCompanyID, Me!txtCompanyName)

Me!txtAttachments = ActivityCount(1)
Me!txtCallsIncoming = ActivityCount(23)
Me!txtCallsOutgoing = ActivityCount(24)
Me!txtNotes = ActivityCount(22)
Me!txtPrep = ActivityCount(25)
Me!txtReceived = ActivityCount(3) + ActivityCount(4) + ActivityCount(5) + ActivityCount(6) + _
ActivityCount(7) + ActivityCount(9) + ActivityCount(15) + ActivityCount(17) + ActivityCount(18) + _
ActivityCount(19) + ActivityCount(34) + ActivityCount(37) + ActivityCount(38)
Me!txtSearchedOnline = ActivityCount(27)
Me!txtSends = ActivityCount(8) + ActivityCount(10) + ActivityCount(20)
Me!txtTesting = ActivityCount(28)
Me!txtToDos = ActivityCount(29)
Me!txtTraining = ActivityCount(30)


Me!txtCurrentRecord = Me!EventID

Me!txtBlankusedfortabstop.SetFocus


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub Form_Load()

On Error GoTo ErrorHandler

DoCmd.MoveSize 4480, 1460


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub Form_Unload(Cancel As Integer)

On Error GoTo ErrorHandler

Dim rs As Object
Dim lngBookmark As Long

' set a variable to the current record
lngBookmark = Forms!fmainCompany.txtCompanyID

'requery the fmainCompany form
Forms!fmainCompany.Requery
DoCmd.GoToRecord , , acLast

'bring us back to the original record
Set rs = Forms!fmainCompany.RecordsetClone
rs.FindFirst "CompanyID = " & lngBookmark
Forms!fmainCompany.Bookmark = rs.Bookmark


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub imgNote_DblClick(Cancel As Integer)

On Error GoTo ErrorHandler

DoCmd.OpenForm "fdlgEventNoteEdit", , , "[EventID] = " & Me.txtEventID


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
--------------------------------------------------------------------------------------------------------------

Private Sub imgPaperClip_DblClick(Cancel As Integer)

On Error GoTo ErrorHandler

DoCmd.OpenForm "frmViewAttachment", , , "[EventID] = " & Me!txtEventID


CleanUpAndExit:
Exit Sub

ErrorHandler:
Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
"Description: " & Err.Description & vbCrLf & _
"Error Number: " & Err.Number, vbCritical, gstrAppTitle)
Resume CleanUpAndExit

End Sub
 
This does not look correct, but not sure if it is the cause of the problem. However, you may be locking a bookmark or recordset. If you comment this out does the form work? What are you actually trying to do? You requery the form, go to the last record, return to the record, and set a bookmark, all on the unload event. This makes no sense to me.
Code:
Private Sub Form_Unload(Cancel As Integer)

On Error GoTo ErrorHandler

    Dim rs As Object
    Dim lngBookmark As Long
    
    ' set a variable to the current record
    lngBookmark = Forms!fmainCompany.txtCompanyID
    
    'requery the fmainCompany form
    Forms!fmainCompany.Requery
    DoCmd.GoToRecord , , acLast
    
    'bring us back to the original record
    Set rs = Forms!fmainCompany.RecordsetClone
    rs.FindFirst "CompanyID = " & lngBookmark
    Forms!fmainCompany.Bookmark = rs.Bookmark
    
    
CleanUpAndExit:
    Exit Sub

ErrorHandler:
    Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
        "Description:  " & Err.Description & vbCrLf & _
        "Error Number:  " & Err.Number, vbCritical, gstrAppTitle)
    Resume CleanUpAndExit

End Sub

Again what I would be looking for, based on you error message are instances when you have either multiple forms bound to the memo field open at the same time. Or where there are recordsets in code bound to the field and a form/s bound to that field.


The other events that could be causing this are only the on load and on current. I doubt the other events could effect this. So if you are error checking start by commenting these out. I would start with this event. Also why use the unload event not the close event?
 
Okay, you're giving me something to think about and try. I think it was suggested to me to use the Unload event to requery the main form.

The Bookmark code--well, the frmViewEventHistory is a short list of events that you can click on to see the details for that event. After clicking and viewing the details I wanted to return to the position I was at on the list and have the correct number count display (that is 1 of 100 instead of 1 of 1 that way I put the DoCmd.GoToRecord , , acLast).
 
Sorry. I misread which form was calling this code. That makes more sense. Probably a better version is:
Code:
Private Sub Form_close()

On Error GoTo ErrorHandler

    Dim lngID As Long
    dim frm as access.form

    set frm = Forms!fmainCompany
    ' set a variable to the current record
    lngIDk = Frm.txtCompanyID
    'requery the fmainCompany form
    frm.Requery
    'Not sure if the movelast is needed. Try without. I do not think it does anything. 
    'At a minimum you need to be specific
    'DoCmd.GoToRecord acDataForm,frm.name, acLast
    'If I had to do this then I would use
    'frm.recordset.movelast
    'bring us back to the original record
    frm.recordset.findfirst "CompanyID = " & lngID
    
CleanUpAndExit:
    Exit Sub

ErrorHandler:
    Call MsgBox("An error was encountered" & vbCrLf & vbCrLf & _
        "Description:  " & Err.Description & vbCrLf & _
        "Error Number:  " & Err.Number, vbCritical, gstrAppTitle)
    Resume CleanUpAndExit

End Sub
 
Okay, I'll look it later bc I have to go to bank and post office.
 
Okay. I have a hunch this is where the problem is. I could envision the unload and the RS reference possibly locking the field. But still a guess.
 
Hey MajP,

No, that did not solve the problem.

If I close frmViewEventHistory that seems to solve the problem. I've been working all week on it. I guess I will have to eliminate that form or just close it each time.

Anyway, thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top