Filter report by fields with Null value

lovett10

Registered User.
Local time
Today, 14:59
Joined
Dec 1, 2011
Messages
150
This is my code so far

Code:
ElseIf Me.chkIncompleted = True Then
         strFilter = "[Total Hours Worked] = IsNull"
            DoCmd.Close
        DoCmd.OpenReport "VisitSheetTableReport", acViewReport, , strFilter

What i want to achieve is it to return any records that have "Total Hours Worked" Blank so that the user will know that that record is incompleted

Thanks in advances for the help.
 
Code:
strFilter = "[Total Hours Worked] [COLOR=Blue]Is Null[/COLOR]"
 
Look at my code and compare it to yours. Are they the same?
 
Eye for detail lovett ;) Mine doesn't have the equal to sign (=) :)
 
Eye for detail lovett ;) Mine doesn't have the equal to sign (=) before Is Null. :)

When you're giving code by one of us on here, the best thing to do is to copy it rather than try to fix yours.
 
Eye for detail lovett ;) Mine doesn't have the equal to sign (=) before Is Null. :)

When you're giving code by one of us on here, the best thing to do is to copy it rather than try to fix yours.

Wow i cant believe i didnt see that haha, thanks again mate
 
Sorry to botheryou ain but do you know what the problem with this code is?
Code:
 ElseIf Me.chkIncompleted = True And Me.cbrEngineer & "" <> "" Then
         strFilter = "[Total Hours Worked] Is Null" And " & _
                        "[Engineer 1] = '" & Me!cbrEngineer & "'Or " & _
                        "[Total Hours Worked] Is Null" And " &" _
                        "[Engineer 2] = '" & Me!cbrEngineer & "'Or " & _
                        "[Total Hours Worked] Is Null" And " &" _
                        "[Engineer 3] = '" & Me!cbrEngineer & "'"
                DoCmd.Close
        DoCmd.OpenReport "VisitSheetTableReport", acViewReport, , strFilter

i get a syntax error
 
Everything is. Start with these two lines:
Code:
         strFilter = "[Total Hours Worked] Is Null[COLOR=Red]" And " [/COLOR]& _
                        "[Engineer 1] = '" & Me!cbrEngineer & "[COLOR=Red]'Or "[/COLOR] & _
I've highlighted the places that need fixing. Take a good look.

Also, you still haven't normalised.
 
Everything is. Start with these two lines:
Code:
         strFilter = "[Total Hours Worked] Is Null[COLOR=red]" And " [/COLOR]& _
                        "[Engineer 1] = '" & Me!cbrEngineer & "[COLOR=red]'Or "[/COLOR] & _
I've highlighted the places that need fixing. Take a good look.

Also, you still haven't normalised.


I cant see where its gone wrong... and Normalized?
 
You're not being patient and thorough with your investigation. Look again paying attention to spaces and concatenation.

Re normalising, I remember telling you about your Engineer1 to 4 issue. You obviously didn't take that on board.
 
You're not being patient and thorough with your investigation. Look again paying attention to spaces and concatenation.

Re normalising, I remember telling you about your Engineer1 to 4 issue. You obviously didn't take that on board.

I didnt understand what you meant before and then had to do something else, and the rest of them work so why change it?
 
That was just a side note. You can ask about that in a different thread if you want. Lookup the term database normalization.

But back to your OP, have you fixed it?
 
That was just a side note. You can ask about that in a different thread if you want. Lookup the term database normalization.

But back to your OP, have you fixed it?


No. i cant see what the problem is... sorry
 

Users who are viewing this thread

Back
Top Bottom