G
Guest
I have tried suggestions under filtering threads, but it keeps
asking me for a value for both my fields, and even if I input the value in
the dialog presented, it
does not filter anyway.
Background:
I have a header form and a detail form.
There is a (No Issues) checkbox on the header that means that there
are/should not be any detail (Issues) present in the detail, for the
ProjectID that is in the header. Note: Detail entries have different
project numbers, other than the one I check in the header. I need to match
the one that is in the header.
I have gone through about 4 iterations of this code, but this was my last try:
'note that these ProjectID's are Decimals (don't ask. designed by another
vendor)
'this code is located in form activate and validates the detail, when the
CheckBox is true.
Set frm = Me.frmProjectIssue.Form 'the detail form
'Me is the header form
frm.Filter = "Me.[ProjectId].Value - frm.[ProjectId].Value = 0"
'suggestion from another thread
frm.FilterOn = True
If frm.NewRecord Then
'no records found for filter 'OK-'suggestion from another thread
frm.Filter = ""
frmFilterOn = True
Else 'records were found for ProjectID in header 'NOT ok
frm.Filter = ""
frmFilterOn = True
... <code to present msgbox and uncheck the header checkbox>
Where am I going astray here and is there an easier way to check to see if
-any- matching (header ID = any detail) ID with the same value)?
asking me for a value for both my fields, and even if I input the value in
the dialog presented, it
does not filter anyway.
Background:
I have a header form and a detail form.
There is a (No Issues) checkbox on the header that means that there
are/should not be any detail (Issues) present in the detail, for the
ProjectID that is in the header. Note: Detail entries have different
project numbers, other than the one I check in the header. I need to match
the one that is in the header.
I have gone through about 4 iterations of this code, but this was my last try:
'note that these ProjectID's are Decimals (don't ask. designed by another
vendor)
'this code is located in form activate and validates the detail, when the
CheckBox is true.
Set frm = Me.frmProjectIssue.Form 'the detail form
'Me is the header form
frm.Filter = "Me.[ProjectId].Value - frm.[ProjectId].Value = 0"
'suggestion from another thread
frm.FilterOn = True
If frm.NewRecord Then
'no records found for filter 'OK-'suggestion from another thread
frm.Filter = ""
frmFilterOn = True
Else 'records were found for ProjectID in header 'NOT ok
frm.Filter = ""
frmFilterOn = True
... <code to present msgbox and uncheck the header checkbox>
Where am I going astray here and is there an easier way to check to see if
-any- matching (header ID = any detail) ID with the same value)?