Form won't update blank field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main form that has a command button that opens a pop-up form to add
comments to the main form. Each form gets it's data from a query. When the
pop-up form opens, if there is data already in the field, you can add/change
the information and it changes it on the form and the table. If that field
has no data in it, then it doesn't update it at all. It works perfectly if
there is data already there but not if there is none. Could you please help.
This is the code that works with the data already in the field.

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Input Response"

stLinkCriteria = "[Cingular_Response]=" & "'" & Me![Cingular_Response] &
"'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
 
Your code is opening a form based specifically on finding the exact message
in stLinkCriteria. If there is no data in the field there is no way to find
anything.
Additionally, if there were Two records with the exact same
[Cingular_Response] your form will not know which record to edit.

Why aren't you allowing the user to edit the field directly on the Main
Form? If you are trying to protect other data, you can set the properties
on all of the fields except Me![Cingular_Response] to Locked = Yes. This
will prevent anyone from changing anything but Me![Cingular_Response] .

Len
 
Back
Top