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. - =IIf([Check5]=0,[received_date]=Null,Date())
Thank you for the help.
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.
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.
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?
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.
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 : - =IIf([Check5],Date(),Null)
If not, then you'll need to explain how [Received_Date] fits in.
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.
NeoPa 32,556
Recognized Expert Moderator MVP
If I understand you correctly then you're actually looking for the following code. - Private Sub Check5_AfterUpdate()
-
Me.Received_Date = IIf(Me.Check5,Date(),Null)
-
End Sub
NB. This would be in the AfterUpdate event procedure (not lost focus and not properties).
Thank you very much, that works.
NeoPa 32,556
Recognized Expert Moderator MVP
It's a pleasure to Help :)
Sign in to post your reply or Sign up for a free account.
Similar topics
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
--------------------------------------------------------------------------------
...
|
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...
|
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...
|
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...
|
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...
|
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...
|
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
...
|
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...
|
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...
|
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 -...
|
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...
|
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,...
|
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: 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,...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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 ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |