I have attached a mini database - here is my dilemna (I have tried various combinations of code but just can't get it right)
Here is the scenario:
Open the frmHMO
I would like to double click on a date received and have the comments box pop up.
Then, after filling in comments, close the comments box.
Then go back and double click the same date and have the comments previously entered pop up.
There will come a time where the user double clicks, the Notes box will pop up, and they change their mind and not type any comments.
A record is created though in the notes table.
How do I code and where does it go (On Form Close?) for this?
If Isnull(Me. Comments) then
** Do not create a new record in Notes**
On Error Resume Next
If IsNull(Me.Comments) Then
This will undo whatever changes the user makes for the current record. You should note however that the wheel on a mouse will allow users to scroll through records because you have the Allow Additions, Allow Deletions, etc.. fields set to yes. I'm not sure if this is what you meant to do or allow. You could change those settings to No and then change your Open Form command to acFormAdd. Then that will only allow the addition of comments without scrolling through other recordsets, and also will allow the above Undo command to work properly. You also could take out the close button on your form and place two additional buttons on your form named Save and Cancel. Then place the appropriate code for each button to either save and close or undo/cancel and close.