Dear Sir/Madam
I have a program where I have used a small form as Input / Message Box in place of VB’s InputBox / MsgBox in a click event procedure i.e CmdSave_Click(). Though the code lines are executing in that procedure at a time, the global variable GblBox is not getting the value 1 for executing SaveRecord procedure, which is passing by the FrmMsgBox(a form)’s CmdOK button.
So, can I hold/pause the code lines of Form1 from line no. 6 to 9 till passing the global variable’s value as like as InputBox. Or is there another way to solve. Please, help me to solve this problem. I am eagerly waiting for your reply.
Here are the Code lines
Codes of Form1
1. Private sub CmdSave_click()
2. Form1.enabled = False
3. Load FrmMsgBox
4. FrmMsgBox.visible = True
5. FrmMsgBox.label1.caption=”Do you want to save the record?”
6. If GblMsg=1 then
7. Call SaveRecord
8. End if
9. End Sub
10. Private Sub Form_Load()
11. GblMsg=0 ‘It is a Global variable
12. End Sub
Codes of FrmMsgBox
1. Private sub CmdOK_click()
2. GblMsg=1
3. End Sub
4. Private sub CmdCancel_click()
5. GblMsg=0
6. End Sub