M
MikeF
The following code on a button in frmMaster will open the Companies form,
filtering all records to CompanyID in the current record.
There are multiple records that contain the same CompanyID, but some don't
have anything in the "DetailID" field.
Need the following code to filter as such.
In short, the Companies form needs to be filtered on all records where
CompanyID is the same as the current record *and* DetailID IsNull.
Have implanted a placeholder line where I think its proper syntax should go
....
*** WHERE FIELD “DetailID" Is Null ***
.... Objective is to find that syntax.
Any assistance is greatly appreciated.
Regards,
- Mike
Private Sub btnFrmCompany_Click()
On Error GoTo Err_btnFrmCompany_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCompanies"
stLinkCriteria = "[CompanyID]=" & Me![CompanyID]
*** WHERE FIELD “address†Is Null ***
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btnFrmCompany_Click:
Exit Sub
Err_btnFrmCompany_Click:
MsgBox Err.Description
Resume Exit_btnFrmCompany_Click
End Sub
filtering all records to CompanyID in the current record.
There are multiple records that contain the same CompanyID, but some don't
have anything in the "DetailID" field.
Need the following code to filter as such.
In short, the Companies form needs to be filtered on all records where
CompanyID is the same as the current record *and* DetailID IsNull.
Have implanted a placeholder line where I think its proper syntax should go
....
*** WHERE FIELD “DetailID" Is Null ***
.... Objective is to find that syntax.
Any assistance is greatly appreciated.
Regards,
- Mike
Private Sub btnFrmCompany_Click()
On Error GoTo Err_btnFrmCompany_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmCompanies"
stLinkCriteria = "[CompanyID]=" & Me![CompanyID]
*** WHERE FIELD “address†Is Null ***
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_btnFrmCompany_Click:
Exit Sub
Err_btnFrmCompany_Click:
MsgBox Err.Description
Resume Exit_btnFrmCompany_Click
End Sub