Help needed with Popup Form

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?
 
D

Dirk Goldgar

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top