sambo
Registered User.
- Local time
- Today, 05:51
- Joined
- Aug 29, 2002
- Messages
- 289
I would like to popup a form after a button is clicked. I would like the button click event code to wait until the modal form is closed before continuing. The code will be reliant on the values returned from the modal form. This is a simple task in c++, but I can't seem to find a way to do it in VBA.
psuedo..
1. Is this type of thing even possible in VBA?
2. How do I stop exectution and wait for a value back from DoModal?
3. Is there anything equivalent to DoModal in VBA?
4. Any other way to do all of this?
psuedo..
Code:
Sub OnClick
Dim frm as MyForm
Set frm = New MyForm
integer nRet = frm.DoModal ' -->code should stop executing here and wait
if nRet = IDOK 'The user clicked OK on the modal form
'Do the data exchange
m_strMainFormSerial = frm.m_strModalFormSerial
elseif nRet = IDCANCEL 'The user clicked CANCEL on the modal form
Set frm = Nothing
Exit Sub
endif
'Do some other stuff
Set frm = Nothing
End Sub
2. How do I stop exectution and wait for a value back from DoModal?
3. Is there anything equivalent to DoModal in VBA?
4. Any other way to do all of this?