Popup forms don't update record

  • Thread starter Thread starter Ian Smith
  • Start date Start date
I

Ian Smith

When presenting memo fields, I commonly display the field
in a two or three line field on a main form, but open up a
large editing window when the user clicks into the memo.

Everything usually behaves, but sometimes, records will
get into a state where the edits made on the pop-up form
do not get updated to the record. I have not been able to
determine what differentiates editable records from non-
editable, but once a record behaves that way, it persists
in not updating, even from one Access session to another.
If I disable the on-click event, the same memo field can
be edited from the main form.

Can anyone suggest what might be wrong with my code, or
what is it about a record that prevents the update?


in frmMain:
Private Sub txtMemo_Click()

' Upon a mouse click inside the note, present the note in
a large window.
Dim strDocName As String
Dim strLinkCriteria As String

Me.Refresh 'ensure we are not passing a dirty record

strDocName = "frmEditMemo"
strLinkCriteria = "PropertyID = " & Me.PropertyID

' problem exhibited whether dialog form or not
DoCmd.OpenForm strDocName, , , strLinkCriteria, ,
acDialog
End Sub

in frmEditMemo:

Private Sub cmdOK_Click()

DoCmd.close acForm, Me.Name

End Sub
 
i can't tell you why the pop-up form may not update, but
here's a suggested alternative:

instead of opening a separate pop-up form to provide a
larger memo control for data entry, suggest you open a
Zoom box instead. in the OnClick event of your form's memo
control, add the following code

RunCommand acCmdZoomBox

that's all you need.

you could also set the Zoom box to open with a right
click, by using the following


Public Function Zoom(ByVal intButton As Integer)

'use in a form, in the "On Mouse Down" or "On Mouse Up"
properties
'for intButton values, search Help for "MouseDown, MouseUp
Events - Event Procedures"
'may be used in an event procedure, or right on the event
property line as =Zoom()

If intButton = acRightButton Then
RunCommand acCmdZoomBox
End If

End Function

just save the procedure to a public module, and use
wherever you need it.

hth
 
Thanks Tina, but I really need to get to the bottom of
this.

The Zoom box isn't really big enough for the kind of
editing being done here. Plus in some cases, the popup is
displaying addtional fields (e.g. memo author, date
created, etc.)

I would expect that doing the me.refresh before calling
the popup should ensure there's no lock on the memo, but
for these once-in-a-while records, Access acts as if there
is still a lock. In fact, if I try to save the record, I
get a 3188 eror claiming I've got it locked elsewhere on
my machine. Yet for most records, there's no such conflict.
 
hmmm, i see your problem. well, the only other thing i can
think to suggest is to replace the line

Me.Refresh

in your code, with

RunCommand acCmdSaveRecord

hth
 
Back
Top