Help needed with Popup Form

  • Thread starter Thread starter Me
  • Start date Start date
M

Me

I have a form to capture customer data, and when the user has finished
inputting the form, they need to add a reason code. I have a button, which
opens a popup box with the field in. However, if the record has been edited
in any way, or is a new record, the popup box does not allow editing.

Users are currently having to close the record and re-open to click the
button to open this popup, once this has been done, all works well.

Does anyone have any suggestions?
 
Me said:
I have a form to capture customer data, and when the user has finished
inputting the form, they need to add a reason code. I have a button, which
opens a popup box with the field in. However, if the record has been
edited in any way, or is a new record, the popup box does not allow
editing.

Users are currently having to close the record and re-open to click the
button to open this popup, once this has been done, all works well.

Does anyone have any suggestions?


You can get past the problem with the edited record by forcing it to be
saved before opening the popup form. It doesn't make sense to allow the
popup to be opened for a new record, so I would think you should prevent
that. Here's some example code:

If Me.NewRecord And Me.Dirty = False Then
MsgBox "Please complete the form first."
Else

If Me.Dirty Then Me.Dirty = False

DoCmd.OpenForm "YourPopupForm", _
WhereCondition:="ID=" & Me.ID, _
WindowMode:=acDialog

End If
 
Back
Top