473,471 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help on Access Expression

19 New Member
Can someone tell me why this expression doesn't work in the build function of a form? Can a date be null? Check5 is a check box.
Expand|Select|Wrap|Line Numbers
  1. =IIf([Check5]=0,[received_date]=Null,Date())
Thank you for the help.
Aug 28 '08 #1
9 1883
NeoPa
32,556 Recognized Expert Moderator MVP
What do you mean doesn't work?

Certainly to determine if something holds a Null value or not is done differently within VBA and SQL. Neither uses the equality operator (=).

Perhaps if you could explain what you're trying to we could be more help. As it stands it looks like you are trying to assigne (rather than return) a value within the True part of the IIf() function - which makes no sense.
Aug 28 '08 #2
NeoPa
32,556 Recognized Expert Moderator MVP
On closer inspection, the initial "=" would indicate SQL code within a query. In that case to determine if a value is Null you would use "x Is Null", but this still doesn't explain what you're intending to get from this.
Aug 28 '08 #3
kbaisch
19 New Member
I am trying to say, if check box, Check5, is not checked then the field "recieved_date" is null else todays date. Am I totally doing this wrong? Does this help you?
Aug 28 '08 #4
kbaisch
19 New Member
In other words, if the check box isn’t checked then I don’t want a date in the received_date field, if the check box is checked then I do want todays date in the received date_field.
Aug 28 '08 #5
NeoPa
32,556 Recognized Expert Moderator MVP
Pretty well yes :(

Is this formula to be entered into the field [Received_Date] in the query?

If so, then use this :
Expand|Select|Wrap|Line Numbers
  1. =IIf([Check5],Date(),Null)
If not, then you'll need to explain how [Received_Date] fits in.
Aug 28 '08 #6
kbaisch
19 New Member
This formula is to be added to the check5 box “check box” on lost focus in the properties. If the box is check then I want todays date to appear in the received_date box, if it’s not checked then I want received_date to be blank with no date. So the check box comes first then the date box.
Aug 28 '08 #7
NeoPa
32,556 Recognized Expert Moderator MVP
If I understand you correctly then you're actually looking for the following code.
Expand|Select|Wrap|Line Numbers
  1. Private Sub Check5_AfterUpdate()
  2.   Me.Received_Date = IIf(Me.Check5,Date(),Null)
  3. End Sub
NB. This would be in the AfterUpdate event procedure (not lost focus and not properties).
Aug 28 '08 #8
kbaisch
19 New Member
Thank you very much, that works.
Aug 29 '08 #9
NeoPa
32,556 Recognized Expert Moderator MVP
It's a pleasure to Help :)
Aug 29 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
6
by: John Baker | last post by:
Hi: As those who have looked at this newsgroup recently will realize, I am a neophyte with Access, although I have experienced with Approach (the Lotus product). There are things I could easily...
4
by: MLH | last post by:
Access 97 has left examples out of much of HELP that was included in Access 2.0. Anybody know why? Or better still, where to find examples. For example, Access 97 has no example code in its...
1
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am...
7
by: rguarnieri | last post by:
Hi! I'm trying to create a query with a boolean expression like this: select (4 and 1) as Value from Table1 this query return always -1, but when I make the same calculation in visual...
2
by: jaii | last post by:
hi i have a serious problem. I usually work in a database called SAM which is basically MS access. Today i encountered a strange problem. when i double clicked my SAM icon(which is basically a...
4
newnewbie
by: newnewbie | last post by:
I have a query where I need Access to evaluate the "Name" field and return messages "Batch" or "Desktop". The "Name" field contains unique values like ...
2
by: muler | last post by:
Hi all, Can someone please elaborate on (or annotate) this text excerpt I found while reading "The C# Programming Language", by Anders Hejlsberg, Scott Wiltamuth, Peter Golde: Section 7.1 A...
1
by: natalieo | last post by:
Hi everyone , Hope all is well with you guys and girls :) I saw someone had a similar posting in this forum and need some help also with a Access Query Expression. I need an expression to...
1
ollyb303
by: ollyb303 | last post by:
Hello, I have been using the following expression in Access as part of a statement to query an Oracle database: (Sum(CASE WHEN STATS_DAILY_SA.LOGIN_TIME > (STATS_DAILY_SA.SCHEDULED_TIME -...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.