namdam13
Technical User
- May 20, 2009
- 7
Hi Everyone,
I have a YesNo message box that keeps jumping to the "Else" clause.
I have tried all the elements to this and it all seems to work fine but i just cannot get the message box to work at all. I even tried on a different button just to see wether something else was effecting it. I have chacked the code and it looks correct according to my reference material. What am i doing wrong? The code is pasted below:
Private Sub Create_TWC_BT_Click()
If IsNull(Text48) Then
On Error GoTo Err_Create_TWC_BT_Click
Dim stDocName As String
stDocName = "Create_TWC_MCR"
DoCmd.RunMacro stDocName
Exit_Create_TWC_BT_Click:
Exit Sub
Err_Create_TWC_BT_Click:
MsgBox Err.Description
Resume Exit_Create_TWC_BT_Click
Else
Call TWCExistMessage
'leave alone
End If
End Sub
Sub TWCExistMessage()
Dim MbxResponse As Integer
MbxResponse = MsgBox("TWC alread exist do you wish to update it?", vbYesNo + vbQuestion, "Update TWC")
If MxbReponse = vbYes Then
stDocName = "Update_TWC_MCR"
DoCmd.RunMacro stDocName
'This does not seem to action and it skip to the message box below.
Else
MsgBox ("TWC has not been update. Changes have not been saved.")
End If
End Sub
I have a YesNo message box that keeps jumping to the "Else" clause.
I have tried all the elements to this and it all seems to work fine but i just cannot get the message box to work at all. I even tried on a different button just to see wether something else was effecting it. I have chacked the code and it looks correct according to my reference material. What am i doing wrong? The code is pasted below:
Private Sub Create_TWC_BT_Click()
If IsNull(Text48) Then
On Error GoTo Err_Create_TWC_BT_Click
Dim stDocName As String
stDocName = "Create_TWC_MCR"
DoCmd.RunMacro stDocName
Exit_Create_TWC_BT_Click:
Exit Sub
Err_Create_TWC_BT_Click:
MsgBox Err.Description
Resume Exit_Create_TWC_BT_Click
Else
Call TWCExistMessage
'leave alone
End If
End Sub
Sub TWCExistMessage()
Dim MbxResponse As Integer
MbxResponse = MsgBox("TWC alread exist do you wish to update it?", vbYesNo + vbQuestion, "Update TWC")
If MxbReponse = vbYes Then
stDocName = "Update_TWC_MCR"
DoCmd.RunMacro stDocName
'This does not seem to action and it skip to the message box below.
Else
MsgBox ("TWC has not been update. Changes have not been saved.")
End If
End Sub