Remove Blank Fields in Report

G

Guest

I'm trying to remove a blank field in my report through visual basic but it's
giving me a syntax error--I'm new to Access so i'm probably missing something
simple. Here's my code:
Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

IIf([tblgoalbyequipment].[UOM] Is Null, Visible=False, Visible=True)

End Sub

Thanks!
 
G

Guest

It says run time error,
Microsoft Access can't find the field 'l' referred to in your expression.

I had this before also, so im not sure what it's talking about...
Pieter Wijnen said:
try

cancel = isnull([tblgoalbyequipment].[UOM])

Pieter

PPCO said:
I'm trying to remove a blank field in my report through visual basic but
it's
giving me a syntax error--I'm new to Access so i'm probably missing
something
simple. Here's my code:
Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

IIf([tblgoalbyequipment].[UOM] Is Null, Visible=False, Visible=True)

End Sub

Thanks!
 
G

Guest

Maybe i'm looking at it in an alternative way but try this...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

if isnull([UOM]) then
[UOM].visible=false
else
[UOM].visible=true
end if

End Sub

hth
--
Maurice Ausum


PPCO said:
It says run time error,
Microsoft Access can't find the field 'l' referred to in your expression.

I had this before also, so im not sure what it's talking about...
Pieter Wijnen said:
try

cancel = isnull([tblgoalbyequipment].[UOM])

Pieter

PPCO said:
I'm trying to remove a blank field in my report through visual basic but
it's
giving me a syntax error--I'm new to Access so i'm probably missing
something
simple. Here's my code:
Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

IIf([tblgoalbyequipment].[UOM] Is Null, Visible=False, Visible=True)

End Sub

Thanks!
 
G

Guest

I don't understand visual basic language very well and why that would work
instead of what i had, but it did the trick! Thanks!

Maurice said:
Maybe i'm looking at it in an alternative way but try this...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

if isnull([UOM]) then
[UOM].visible=false
else
[UOM].visible=true
end if

End Sub

hth
--
Maurice Ausum


PPCO said:
It says run time error,
Microsoft Access can't find the field 'l' referred to in your expression.

I had this before also, so im not sure what it's talking about...
Pieter Wijnen said:
try

cancel = isnull([tblgoalbyequipment].[UOM])

Pieter

I'm trying to remove a blank field in my report through visual basic but
it's
giving me a syntax error--I'm new to Access so i'm probably missing
something
simple. Here's my code:
Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

IIf([tblgoalbyequipment].[UOM] Is Null, Visible=False, Visible=True)

End Sub

Thanks!
 
G

Guest

My pleasure ;-)
--
Maurice Ausum


PPCO said:
I don't understand visual basic language very well and why that would work
instead of what i had, but it did the trick! Thanks!

Maurice said:
Maybe i'm looking at it in an alternative way but try this...

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

if isnull([UOM]) then
[UOM].visible=false
else
[UOM].visible=true
end if

End Sub

hth
--
Maurice Ausum


PPCO said:
It says run time error,
Microsoft Access can't find the field 'l' referred to in your expression.

I had this before also, so im not sure what it's talking about...
:

try

cancel = isnull([tblgoalbyequipment].[UOM])

Pieter

I'm trying to remove a blank field in my report through visual basic but
it's
giving me a syntax error--I'm new to Access so i'm probably missing
something
simple. Here's my code:
Option Compare Database

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

IIf([tblgoalbyequipment].[UOM] Is Null, Visible=False, Visible=True)

End Sub

Thanks!
 
A

Albert D. Kallal

PPCO said:
I don't understand visual basic language very well and why that would work
instead of what i had, but it did the trick! Thanks!

In your example code, your were reference a table name,a nd that has NO
relation tot he control on the form.


Also note that you DO NOT need any code. Just set the controls can shrink
property = yes, and the controls will move up with out code...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top