Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

make a text box only visible if txtName Has a value entered on a f

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Walter Mills - 16 Jan 2006 14:47 GMT
I need to make a text box (txtfinal) that has an expression like this:
If "txt1" >8, then subtract 8 from "txt1"
and also if lstName is null then txtFinal is null also

"txt1" is a text box from a form that has a mathematical equation on it.  
the final number is imported into the "txtFinal" if the number is greater
than 8 it needs to have 8 subtracted from it.

"lstName" is a list box on the same report with user name in it.  It
references a specific user ID and Name from a form.   (if this value is null,
then  the "txtFinal" does not need to appear).

The key is that I cannot get the txtFinal to ONLY APPEAR IF NEEDED (if
txtName IS NOT Blank.  I have tried for weeks to figure out the code to work
but cannot figure it out..... please help.....
tina - 16 Jan 2006 15:40 GMT
try

=IIf([1stName] Is Null, Null, IIf([txt1] > 8, [txt1] - 8, [txt1]))

hth

> I need to make a text box (txtfinal) that has an expression like this:
> If "txt1" >8, then subtract 8 from "txt1"
[quoted text clipped - 11 lines]
> txtName IS NOT Blank.  I have tried for weeks to figure out the code to work
> but cannot figure it out..... please help.....
Marshall Barton - 16 Jan 2006 15:43 GMT
>I need to make a text box (txtfinal) that has an expression like this:
>If "txt1" >8, then subtract 8 from "txt1"
[quoted text clipped - 11 lines]
>txtName IS NOT Blank.  I have tried for weeks to figure out the code to work
>but cannot figure it out..... please help.....

Try this kind of expression in the report text boxes:

=IIf(lstName Is Null, Null,
IIf(Forms!theform.Forms!theform.txt1 > 8,
Forms!theform.Forms!theform.txt1 - 8,
Forms!theform.Forms!theform.txt1))

But you will probably have to unravel the references because
I am not sure which items are on the form and which ones on
in the report.  It would have helped me keep it straight if
you had provided the name of the form and report.

Signature

Marsh
MVP [MS Access]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.