Thanks Ofer,
I've also got upto this point. I reproduce the exact code I'm using. But,
I'm clueless as to how to handle User Responses just like in regular VBA
MsgBox function.
--
Sreedhar
The Code:
Private Sub Form_Load()
On Error GoTo Err_Load
Dim strTitle As String
Dim strMessage As String
Dim strStyle As String
If Not IsNull(Me.OpenArgs) Then
strTitle = ParseWord(Me.OpenArgs, 1, ";")
strMessage = ParseWord(Me.OpenArgs, 2, ";")
strStyle = ParseWord(Me.OpenArgs, 3, ";")
Me!txtTitle = strTitle
Me!txtMessage = strMessage
Select Case strStyle
Case "1"
For Each ctl In Me.Controls
If Left(ctl.Tag, 10) = "ButtonSet1" Then
If ctl.Tag = "ButtonSet1_cmd" Then ctl.Caption = "&Yes"
If ctl.Tag = "Buttonset1_lb" Then ctl.Caption = "&Yes"
End If
If Left(ctl.Tag, 10) = "ButtonSet2" Then
If ctl.Tag = "ButtonSet2_cmd" Then ctl.Caption = "&No"
If ctl.Tag = "Buttonset2_lb" Then ctl.Caption = "&No"
End If
If Left(ctl.Tag, 10) = "ButtonSet3" Then
ctl.Visible = False
End If
Next
Case "2"
For Each ctl In Me.Controls
If Left(ctl.Tag, 10) = "ButtonSet1" Then
If ctl.Tag = "ButtonSet1_cmd" Then ctl.Caption = "&Yes"
If ctl.Tag = "Buttonset1_lb" Then ctl.Caption = "&Yes"
End If
If Left(ctl.Tag, 10) = "ButtonSet2" Then
If ctl.Tag = "ButtonSet2_cmd" Then ctl.Caption = "&No"
If ctl.Tag = "Buttonset2_lb" Then ctl.Caption = "&No"
End If
If Left(ctl.Tag, 10) = "ButtonSet3" Then
If ctl.Tag = "ButtonSet3_cmd" Then ctl.Caption = "&Cancel"
If ctl.Tag = "Buttonset3_lb" Then ctl.Caption = "&Cancel"
End If
Next
Case "3"
For Each ctl In Me.Controls
If Left(ctl.Tag, 10) = "ButtonSet1" Then
If ctl.Tag = "ButtonSet1_cmd" Then ctl.Caption = "&OK"
If ctl.Tag = "Buttonset1_lb" Then ctl.Caption = "&OK"
End If
If Left(ctl.Tag, 10) = "ButtonSet2" Then
ctl.Visible = False
End If
If Left(ctl.Tag, 10) = "ButtonSet3" Then
ctl.Visible = False
End If
Next
Case "4"
For Each ctl In Me.Controls
If Left(ctl.Tag, 10) = "ButtonSet1" Then
If ctl.Tag = "ButtonSet1_cmd" Then ctl.Caption = "&OK"
If ctl.Tag = "Buttonset1_lb" Then ctl.Caption = "&OK"
End If
If Left(ctl.Tag, 10) = "ButtonSet2" Then
If ctl.Tag = "ButtonSet2_cmd" Then ctl.Caption = "&Cancel"
If ctl.Tag = "Buttonset2_lb" Then ctl.Caption = "&Cancel"
End If
If Left(ctl.Tag, 10) = "ButtonSet3" Then
ctl.Visible = False
End If
Next
End Select
End If
Exit_Load:
Exit Sub
Err_Load:
ErrorLog "Form_Load", Err, Error
Resume Exit_Load
End Sub