473,394 Members | 1,813 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

If Statement Unbound Text Box

Hope I make my case clear!!!

I have a table with two bound date/time fields.

I want to be able to use an IF statement and DateDiff to return a text
message in an unbound text box. I want to do this all from the control
source of the unbound text box. What I think it should look like is
something like this;

If(DateDiff("d",[Date1],[Date2])) > 5, Then Display "On Time"

I want datediff to subtract the two dates and if the result is greater
then 5 I want my unbound text box to display the words "On Time".

Is this possible, and if so how could I do this. I am no experience
with VBA and am just learning all the quirks to control entry.

Thanks for all your help folks.

Nov 13 '05 #1
2 8156
"hm*****@hartford.edu" <hm*****@hartford.edu> wrote in
news:11**********************@g47g2000cwa.googlegr oups.com:
Hope I make my case clear!!!

I have a table with two bound date/time fields.

I want to be able to use an IF statement and DateDiff to
return a text message in an unbound text box. I want to do
this all from the control source of the unbound text box. What
I think it should look like is something like this;

If(DateDiff("d",[Date1],[Date2])) > 5, Then Display "On Time"

I want datediff to subtract the two dates and if the result is
greater then 5 I want my unbound text box to display the words
"On Time".

Is this possible, and if so how could I do this. I am no
experience with VBA and am just learning all the quirks to
control entry.

Thanks for all your help folks.

the IIF function (Immediate IF) is how to do what you want.
IIf(true or false value, value if True, value if false)

So your control source becomes
=IIf(DateDiff("d",[Date1],[Date2]) > 5, "On Time", "")

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #2
Thanks for the help Bob.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: N. Graves | last post by:
Hello, Please help me I'm still a newbie. I have an unbound text box on a report that I would like to build a expression to display it on the report. Something like txtboxSearchCriteria = !!...
7
by: Aravind | last post by:
Hi folks. I have 2 forms, frmBorrow and frmHistory frmBorrow has an unbound multi-column combo box (cboMember) and 7 unbound text boxes (MemNo, MemName, MemIC, MemType, CourseFaculty, Borrow,...
2
by: Zlatko Matić | last post by:
Hello. I have the following problem with MS Access/PostgreSQL combination: There is a form in Access that has an unbound text box, used for entering a commentary of a batch of records. There is a...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
1
by: MyWaterloo | last post by:
I have an unbound text box on my main form that is used to show the sum totals in my sub form. I also have a field on my main form that has a control source in a table. This bound field needs to...
4
by: sumit kale | last post by:
Hi, Can somebody help me resolve my problem ? I am getting error when calculating total using unbound textfiled in subform. I have a main form called purchase_register_master and a subform...
9
by: sillyr | last post by:
Hi - I have an unbound text box on a form that calculates a value from a bound text box on the same form. Right now the equation I'm using is =Val(NZ())*0.20 but I would like to have it so if...
7
by: HSXWillH | last post by:
I am designing an inventory system and am stuck on a potential problem. I have a table of Stock_Catalog containing the following fields: Stock_ID (random autonumber), Full_Desc, Serial, Auto,...
2
topher23
by: topher23 | last post by:
Disclaimer: I've already come up with a solution for this issue, but I thought I'd post it in the hope that it could help someone else and on the off chance that someone has another solution. I...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.