W
wendyhnc
I have used the following code which works great, the only thing is that I
want my subform to open as a dialog form.
Private Sub Inactivate_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_Inactivate_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![Company_Name]) Then
strMsg = "Move to the vendor record you want to see, then press the
Inactivate button again."
intStyle = vbOKOnly
strTitle = "Select a Vendor"
MsgBox strMsg, intStyle, strTitle
Me![Company_Name].SetFocus
Else
' Otherwise, open Inactivate Vendor form for current vendor.
strDocName = "POP:Company_Inactivation"
strLinkCriteria = "Company_ID = " +
CStr(Forms![F:Vendor_Entry]![Company_ID])
DoCmd.OpenForm strDocName
Forms![POP:Company_Inactivation].Filter = strLinkCriteria
Forms![POP:Company_Inactivation].FilterOn = True
End If
Exit_Inactivate_Click:
Exit Sub
Err_Inactivate_Click:
MsgBox Err.Description
Resume Exit_Inactivate_Click
End Sub
If I use DoCmd.OpenForm strDocName, acNormal, ,
Forms![POP:Company_Inactivation].Filter = strLinkCriteria, acFormEdit,
acDialog
the form comes up in dialog mode but the filter is not applied. I am
stumped! Any suggestions would be appreciated.
Thanks!
want my subform to open as a dialog form.
Private Sub Inactivate_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_Inactivate_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![Company_Name]) Then
strMsg = "Move to the vendor record you want to see, then press the
Inactivate button again."
intStyle = vbOKOnly
strTitle = "Select a Vendor"
MsgBox strMsg, intStyle, strTitle
Me![Company_Name].SetFocus
Else
' Otherwise, open Inactivate Vendor form for current vendor.
strDocName = "POP:Company_Inactivation"
strLinkCriteria = "Company_ID = " +
CStr(Forms![F:Vendor_Entry]![Company_ID])
DoCmd.OpenForm strDocName
Forms![POP:Company_Inactivation].Filter = strLinkCriteria
Forms![POP:Company_Inactivation].FilterOn = True
End If
Exit_Inactivate_Click:
Exit Sub
Err_Inactivate_Click:
MsgBox Err.Description
Resume Exit_Inactivate_Click
End Sub
If I use DoCmd.OpenForm strDocName, acNormal, ,
Forms![POP:Company_Inactivation].Filter = strLinkCriteria, acFormEdit,
acDialog
the form comes up in dialog mode but the filter is not applied. I am
stumped! Any suggestions would be appreciated.
Thanks!