473,326 Members | 2,173 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,326 software developers and data experts.

Do nothing if form field is blank

Hi Everyone,

First time posting I just started getting into access, and have a limited coding background so forgive me if I'm unclear.

I'm trying to make a form that will update a due date and received date but will do nothing if the field is blank. Right now if I leave the field blank then it updates the values to be blank. Right now I've got this basic bit of code, but I don't know what to put in the truepart to make it work...

Expand|Select|Wrap|Line Numbers
  1. Iif(IsNull([DueDate]), truepart, [DueDate])
Any suggestions would be appreciated!
Oct 14 '15 #1
2 1843
jforbes
1,107 Expert 1GB
You can set it to itself if you don't want to change it. If the name of the field you are setting is [SomeDate]:
Expand|Select|Wrap|Line Numbers
  1. Iif(IsNull([DueDate]), [SomeDate], [DueDate])
Depending on what you are doing, this may not always be the best idea. Setting a value to itself is often still considered making a change to the data which can trigger other things to happen. So, sometimes it's best to check to see if the value needs changed before setting a value. It may not matter in your case, I'm just giving you a little additional information.
Oct 15 '15 #2
NeoPa
32,556 Expert Mod 16PB
It's not really clear if this is VBA work or SQL, as there is no context for it.

However, I believe the format you're looking for is very similar to what JForbes already posted :
Expand|Select|Wrap|Line Numbers
  1. IIf(IsNull([DueDate]), Null, [SomeDate])
In my understanding of the situation, the resultant value would be assigned to [DueDate].
Oct 16 '15 #3

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

Similar topics

1
by: ratlhead | last post by:
Hey all, I've provided a form for a client of the company I work for that basically emails the form data to an email address. Only a couple of the many fields are required...nothing too fancy....
1
by: Jerry Sievers | last post by:
Fellow coders; I am curious about a difference in behavior between Mozilla and MSIE. The scenario; 1. a php form page is loaded on first hit with field values set to various things including...
7
by: JDS | last post by:
Hi, all. I'd like to do the following, preferably *without* resorting to JavaScript: I have a long, dynamically-generated form questionnaire. Not all of the form fields are dynamically...
2
by: www | last post by:
Hi there, I' m getting a (0x80040E2F) error, if I submit my form, with blank textboxes to my update stored procedure. The stored procedure expect values, so how can I detect if a form field was...
1
by: Keith | last post by:
I am Using Dreamweaver MX to create my site and have come accross a problem no one in the DW groups seems to be able to help with. When I submit an insert to my SQL database, any form value which...
1
by: Martin Nadoll | last post by:
Hello, i have a few problems with form field validation: First i have to check, wether a field is filled with 10 integer numbers. Also allowed is " " and "-" but no letters, and the input of ...
3
by: Shabam | last post by:
I know that dotnet allows for form field validation. However I'm looking to customize the error message display and am wondering if it's possible to do what I need. Example: Suppose in a...
3
by: Steve Wright | last post by:
I want to build an email subject containing text and a form field. Have have got so far but all I seem to be able to do is generate another page in the browser with a text string. (code attached)...
1
robin a
by: robin a | last post by:
I have a tabbed that contains a form NavigationSubform (this was auto-named so I don't know if it goes in the syntax for what I'm trying to do) I am concerned with a form named...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.