1. Project Form now referred as projform
2. Project Risk_Details Form now referred as projriskform
Now I want that all the fields to be filled in projform before I migrate to the projriskform. So I have tried to make the all the field "Required" in the table. But how can I modify the message that it displays?
Also where should I place the macro of opening the projriskform and I should display the message that entry has been stored in the table?
I have tried to place the openform macro after the saverecord(developed using the record operation of the form wizard) button but the problem is that the form migrates even when the form is not complete.
https://www.dropbox.com/s/kf4mgfgq6gl62vu/savemacro.jpg
I have even tried with after_insert event but that is not working.
I have tried after update thing as well but that also dose not seem to work as I have other things as well running in after update event
Have a look as code below
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- ' Next is used to save value for correct confirmaton message.
- Dim IsNewRec As Integer
- Private Sub Sector_AfterUpdate()
- 'For the sub sector display
- SubSector = Null
- SubSector.Requery
- SubSector = Me.SubSector.ItemData(0)
- ' Display confirmation Message.
- If (IsNewRec = 1) Then
- MsgBox "Order Added.", vbInformation, "Confirmation"
- Else
- MsgBox "Order Updated.", vbInformation, "Confirmation"
- End If
- End Sub
- Private Sub Form_Current()
- 'For the sub sector display
- SubSector.Requery
- ' set newrec switch for confirmation.
- If (Me.NewRecord) Then
- IsNewRec = 1
- Else
- IsNewRec = 0
- End If
- End Sub
- Private Sub Form_Load()
- If IsNull(Sector) Then
- Sector = Me.Sector.ItemData(0)
- Call Sector_AfterUpdate
- End If
- 'If IsNull(Project_Name) Then
- 'DoCmd.GoToRecord , , acNewRec
- 'End If
- End Sub