|
-
Dec 8th, 2013, 11:16 AM
#1
Thread Starter
New Member
How to save the information in the form if it accidentally gets closed?
Hi,
I have a form which has a list box and text box with employee details. The form is used to track day to day activities. The form should be opened for 9 hours continuously. But automatic system restart or mandatory reboot in the mid of the working hours makes it difficult to save the details. How to do this using VBA. I've tried "DoCmd.Runcommand acCmdSaveRecord" in the code but of no use.
Any suggestions?
-
Dec 8th, 2013, 03:22 PM
#2
Re: How to save the information in the form if it accidentally gets closed?
while vba userforms have an event
Code:
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
'code here will run if form tries to close
End Sub
i do not know if access forms have a similar event
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|