Formating a reprot with macros

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I am doing a database for work, and I am trying to print a report that
is a truck log. I have everything working on the daily truck log except one
things. What I can't get it to do is display the dropped message when a
trailer if dropped. With in the database, I have a check box for dropped,
then I set up a visual basic script that said:
If [Drop].value=true then
[LblDrop].visible=true
Else
[LblDrop].visible=false
End if
When I try to view the form, I get an error on the first line of the code
saying "you've entered an expresion that has no value". Can anyone help me
solve this problem.

THanks,
Mike
 
Mike said:
I am doing a database for work, and I am trying to print a report that
is a truck log. I have everything working on the daily truck log except one
things. What I can't get it to do is display the dropped message when a
trailer if dropped. With in the database, I have a check box for dropped,
then I set up a visual basic script that said:
If [Drop].value=true then
[LblDrop].visible=true
Else
[LblDrop].visible=false
End if
When I try to view the form, I get an error on the first line of the code
saying "you've entered an expresion that has no value".


You probably have that code in the wrong place (Open
event??). It should be in the Format event of the section
containing the Drop control.

BTW, you can accomplish the same thing with fewer lines:

[LblDrop].Visible = [Drop].Value
 
Thanks for the reply,
I put the code you suggested in the format event for the detail
sections, since this is the section that contains the drop field. I am still
getting the same error though. If anyone has any suggestions please let me
know.

Mike


Marshall Barton said:
Mike said:
I am doing a database for work, and I am trying to print a report that
is a truck log. I have everything working on the daily truck log except one
things. What I can't get it to do is display the dropped message when a
trailer if dropped. With in the database, I have a check box for dropped,
then I set up a visual basic script that said:
If [Drop].value=true then
[LblDrop].visible=true
Else
[LblDrop].visible=false
End if
When I try to view the form, I get an error on the first line of the code
saying "you've entered an expresion that has no value".


You probably have that code in the wrong place (Open
event??). It should be in the Format event of the section
containing the Drop control.

BTW, you can accomplish the same thing with fewer lines:

[LblDrop].Visible = [Drop].Value
 
Mike said:
I put the code you suggested in the format event for the detail
sections, since this is the section that contains the drop field. I am still
getting the same error though. If anyone has any suggestions please let me
know.

I don't know. That message usually means the code is legal,
but the Value hasn't been determined yet (open Event) or
that it refers to a control that doesn't have a value
property (Lable, line, etc). Check the name of the Drop
text/check box in the detail section and make sure it isn't
some other kind of control. Double check that the Drop
Field is in the report's record source table/query.
--
Marsh
MVP [MS Access]


Mike said:
I am doing a database for work, and I am trying to print a report that
is a truck log. I have everything working on the daily truck log except one
things. What I can't get it to do is display the dropped message when a
trailer if dropped. With in the database, I have a check box for dropped,
then I set up a visual basic script that said:
If [Drop].value=true then
[LblDrop].visible=true
Else
[LblDrop].visible=false
End if
When I try to view the form, I get an error on the first line of the code
saying "you've entered an expresion that has no value".
Marshall Barton said:
You probably have that code in the wrong place (Open
event??). It should be in the Format event of the section
containing the Drop control.

BTW, you can accomplish the same thing with fewer lines:

[LblDrop].Visible = [Drop].Value
 
Thanks again for the reply,
For some reason I can't get it to work with a check box, but if I put a
text box, and place an X in it to denote a dropped trailor, then use an if
statement based on the text box, it works. So, I guess I'll do it that way,
its almost as easy for me to just type an x in the box as it was to select it.

Mike


Marshall Barton said:
Mike said:
I put the code you suggested in the format event for the detail
sections, since this is the section that contains the drop field. I am still
getting the same error though. If anyone has any suggestions please let me
know.

I don't know. That message usually means the code is legal,
but the Value hasn't been determined yet (open Event) or
that it refers to a control that doesn't have a value
property (Lable, line, etc). Check the name of the Drop
text/check box in the detail section and make sure it isn't
some other kind of control. Double check that the Drop
Field is in the report's record source table/query.
--
Marsh
MVP [MS Access]


Mike W wrote:
I am doing a database for work, and I am trying to print a report that
is a truck log. I have everything working on the daily truck log except one
things. What I can't get it to do is display the dropped message when a
trailer if dropped. With in the database, I have a check box for dropped,
then I set up a visual basic script that said:
If [Drop].value=true then
[LblDrop].visible=true
Else
[LblDrop].visible=false
End if
When I try to view the form, I get an error on the first line of the code
saying "you've entered an expresion that has no value".
Marshall Barton said:
You probably have that code in the wrong place (Open
event??). It should be in the Format event of the section
containing the Drop control.

BTW, you can accomplish the same thing with fewer lines:

[LblDrop].Visible = [Drop].Value
 
Mike said:
For some reason I can't get it to work with a check box, but if I put a
text box, and place an X in it to denote a dropped trailor, then use an if
statement based on the text box, it works. So, I guess I'll do it that way,
its almost as easy for me to just type an x in the box as it was to select it.

I kind of prefer a text box for this anyway and you can
program it to react just like a check box, e.g. the click
event can toggle the value.

Wait a minute, you don't have this check box in an option
group frame do you? In an option group, only the frame has
a Value property.
--
Marsh
MVP [MS Access]


Marshall Barton said:
Mike said:
I put the code you suggested in the format event for the detail
sections, since this is the section that contains the drop field. I am still
getting the same error though. If anyone has any suggestions please let me
know.

I don't know. That message usually means the code is legal,
but the Value hasn't been determined yet (open Event) or
that it refers to a control that doesn't have a value
property (Lable, line, etc). Check the name of the Drop
text/check box in the detail section and make sure it isn't
some other kind of control. Double check that the Drop
Field is in the report's record source table/query.
--
Marsh
MVP [MS Access]


Mike W wrote:
I am doing a database for work, and I am trying to print a report that
is a truck log. I have everything working on the daily truck log except one
things. What I can't get it to do is display the dropped message when a
trailer if dropped. With in the database, I have a check box for dropped,
then I set up a visual basic script that said:
If [Drop].value=true then
[LblDrop].visible=true
Else
[LblDrop].visible=false
End if
When I try to view the form, I get an error on the first line of the code
saying "you've entered an expresion that has no value".


:
You probably have that code in the wrong place (Open
event??). It should be in the Format event of the section
containing the Drop control.

BTW, you can accomplish the same thing with fewer lines:

[LblDrop].Visible = [Drop].Value
 
Back
Top