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 / Reports / Printing / December 2005

Tip: Looking for answers? Try searching our database.

Coding a text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bob - 12 Dec 2005 13:08 GMT
Hi I have a text box which I want to pick up the data from field1 if this
IsNull (blank) then I want it to pick up the data from field2. When the
report opens, how do I go about it?

I have tried the following on the reports open event.

If me. Field1 IsNull Then
Me. Text58 = Me.Field2
Else
Me.Text58 = Field1
End If

It didn't work of course where am I going wrong?

Thanks Bob
Brendan Reynolds - 12 Dec 2005 14:11 GMT
"If IsNull(Me.Field1) Then" should work - IsNull() in VBA, IS NULL (with a
space) in SQL. Alternatively, you could use the NZ function, for example,
use an expression such as the following in the Control Source property of
"Text58" ...

= NZ([Field1], [Field2])

Signature

Brendan Reynolds

> Hi I have a text box which I want to pick up the data from field1 if this
> IsNull (blank) then I want it to pick up the data from field2. When the
[quoted text clipped - 11 lines]
>
> Thanks Bob
Bob - 12 Dec 2005 15:28 GMT
Brendan I like the = NZ([Field1], [Field2]) idea but if Field1 is blank I
get an Error in the Text box, other wise it gives the correct result. Any
ideas?

Thanks Bob

> "If IsNull(Me.Field1) Then" should work - IsNull() in VBA, IS NULL (with a
> space) in SQL. Alternatively, you could use the NZ function, for example,
[quoted text clipped - 18 lines]
>>
>> Thanks Bob
dbl - 12 Dec 2005 19:18 GMT
Brendan thanks for all your help, I have now sorted it.

It works fine.

Thanks again Bob

> Brendan I like the = NZ([Field1], [Field2]) idea but if Field1 is blank I
> get an Error in the Text box, other wise it gives the correct result. Any
[quoted text clipped - 24 lines]
>>>
>>> Thanks Bob
 
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.