Prompt to save when using a tab control

  • Thread starter Thread starter forest8
  • Start date Start date
F

forest8

Hi there

In my database, I have a form which consists of 5 tabs.

When a user moves from tab to tab, is it possible to set a prompt that
prompts the user to save their work?

I have users who think that this is a necessary feature of my database.

Thank you in advance for your help.
 
Hi there

In my database, I have a form which consists of 5 tabs.

When a user moves from tab to tab, is it possible to set a prompt that
prompts the user to save their work?

I have users who think that this is a necessary feature of my database.

Thank you in advance for your help.

ummm...

This is somewhat confusing.

Data is not stored in forms or in tabs. The data will automatically be saved
to the table (completely independently of any tabs) when you move to a
different record or close the form; if there are subforms on the tab pages,
data will be saved the instant you leave the subform, or enter a new one.
Moving from one tab page to another will not otherwise cause data to be lost
(or saved either). You certainly don't NEED to interrupt the user, or make
them respond to a prompt, in order to save data. This may just be a user
training issue!

But that said, you can certainly put code in the Change event of the Tab
control, such as

Private Sub tabcontrolname_Change()
Dim iAns as Integer
iAns = MsgBox("Do you want to save your work?", vbYesNo)
If iAns = vbYes Then
If Me.Dirty Then Me.Dirty = False ' save the record to disk
Else
<do something appropriate for not saving the data>
End If
End Sub
 
Back
Top