加一个你的相当于inputbox的那个窗体。命名为form2
在form2上添加textbox :txt
在添加个模块 Module1
form2的代码:
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If p = True Then
Cancel = 0
Else
Me.Hide
Cancel = 1
End If
End Sub
Module1的代码:
Option Explicit
Public p As Boolean
Public Function showfrm(frm As Form) As String
Form2.Show
Do
DoEvents
Loop Until frm.Visible = False
showfrm = frm.Text1.Text
p = True
Unload frm
End Function