office交流網--QQ交流群號

Access培訓群:792054000         Excel免費交流群群:686050929          Outlook交流群:221378704    

Word交流群:218156588             PPT交流群:324131555

ACCESS 技巧韆尋:加強後的MSGBOX函數

2002-04-26 08:02:00
大熊-Office交流網
原創
5185

加強版的MSGBOX函數

Function FormattedMsgBox( _
 Prompt As String, _
 Optional Buttons As VbMsgBoxStyle = vbOKOnly, _
 Optional Title As String = vbNullString, _
 Optional HelpFile As Variant, _
 Optional Context As Variant) _
 As VbMsgBoxResult
 If IsMissing(HelpFile) Or IsMissing(Context) Then
 FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
""", " & Buttons & ", """ & Title & """)")
 Else
 FormattedMsgBox = Eval("MsgBox(""" & Prompt & _
""", " & Buttons & ", """ & Title & """, """ & _
HelpFile & """, " & Context & ")")
 End If
End Function


 
這段代碼最早齣自Usenet,後被MVP Michael Kaplan整理轉載後髮錶在他的網站trigeminal.com,後被微軟選入KB,編號:KB242889

(祘法函數_API_繫統-相關文章技巧鏈接):
ACCESS集錦

分享