Remove Blank Fields in Report

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
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!
 
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!
 
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!
 
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!
 
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...
 
Back
Top