I have an unbound text box on a form that is set to:
Format = Short Date (with the corresponding input mask)
When I run this:
DoCmd.RunSQL ("UPDATE tblOutput SET ApptStart = " & Me!txtApptStart )
the value in the table is only a time value, or some other incorrect date.
The data type and format of the table field matches that of the textbox
field.
I've tried messing around with DateValue and removing the input mask, but
keep getting screwy results.
There must be some way to get the date value into a table with a query...
Am I missing something obvious? 2 5295
You need to explicitly format the literal date in the SQL string, and use
the # delimiter:
DoCmd.RunSQL ("UPDATE tblOutput SET ApptStart = " & _
Format(Me!txtAp ptStart, "\#mm\/dd\/yyyy\#"))
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"deko" <dj****@hotmail .com> wrote in message
news:Hc******** **********@news svr25.news.prod igy.com... I have an unbound text box on a form that is set to:
Format = Short Date (with the corresponding input mask)
When I run this:
DoCmd.RunSQL ("UPDATE tblOutput SET ApptStart = " & Me!txtApptStart )
the value in the table is only a time value, or some other incorrect date.
The data type and format of the table field matches that of the textbox field. I've tried messing around with DateValue and removing the input mask, but keep getting screwy results. There must be some way to get the date value into a table with a query...
Am I missing something obvious?
thanks for the tip.
this was driveing me crazy...
"Allen Browne" <Al*********@Se eSig.Invalid> wrote in message
news:3f******** **************@ freenews.iinet. net.au... You need to explicitly format the literal date in the SQL string, and use the # delimiter:
DoCmd.RunSQL ("UPDATE tblOutput SET ApptStart = " & _ Format(Me!txtAp ptStart, "\#mm\/dd\/yyyy\#"))
-- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org.
"deko" <dj****@hotmail .com> wrote in message news:Hc******** **********@news svr25.news.prod igy.com... I have an unbound text box on a form that is set to:
Format = Short Date (with the corresponding input mask)
When I run this:
DoCmd.RunSQL ("UPDATE tblOutput SET ApptStart = " & Me!txtApptStart )
the value in the table is only a time value, or some other incorrect
date. The data type and format of the table field matches that of the textbox field. I've tried messing around with DateValue and removing the input mask,
but keep getting screwy results. There must be some way to get the date value into a table with a
query... Am I missing something obvious?
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jack |
last post by:
Hi,
I have a form when loaded, retrieves record from an access table. Among
other fields there is a check box called FinalUpdate. This is tied to a field
in Access of type Yes/No.
The form retieves the values perfectly. This form is being used to update
the record in the table via a successconfirmation.asp.
Now, when the checkbox is loaded...
|
by: kalamos |
last post by:
This statement fails
update ded_temp a
set a.balance = (select sum(b.ln_amt)
from ded_temp b
where a.cust_no = b.cust_no
and a.ded_type_cd = b.ded_type_cd
and a.chk_no = b.chk_no
group by cust_no, ded_type_cd, chk_no)
|
by: Hank1234 |
last post by:
Can I use one Data Adapter and one Command Builder to update amny tables?
Currently in my data adapter I query two tables and fill them into two tables
in a data set. When I make a change to a record in the second table and call
the update method of the data adapter the command builders update command
text is for the first table. Can the...
|
by: ZeroVisio |
last post by:
Hi,
I want to know if there is an easy way to do update a column of a row in
DataTable.
|
by: Shapper |
last post by:
Hello,
I have created 3 functions to insert, update and delete an Access
database record. The Insert and the Delete code are working fine.
The update is not. I checked and my database has all the necessary
records in it when testing it. I get the error "No value given for one
or more required parameters." when I try to update the...
| |
by: cover |
last post by:
I have an input form that passes data when submitted to a second form
to let the user know what they have just entered into the db.
My question comes with using 'update'. I'd like to query the database
by equipment number (equipno is unique) and query all fields from that
row, populating an original form 'look alike' whereby the user can...
|
by: Anoop |
last post by:
Hi,
I am new to this newsgroup and need help in the following questions.
1. I am workin' on a GUI application. Does C# provides Layout Managers the
way Java does to design GUI? I know that it can be done using the designer
but I intentionally don't want to use that. The one reason is that you
cannot change the code generated by the...
|
by: eholz1 |
last post by:
Hello PHP programmers.
I had a brilliant idea on one of my pages that selects some data from
my mysql database.
I first set the page up to display some info and an image, just one
item, with a row of data, etc.
then I thought it would be nice to do a select, and perhaps an update
(the title of the image) on the same page.
|
by: fperri |
last post by:
I have a field in my main table called "CHANGE". Each week before we update the data we create a backup of the table and adjust the CHANGE field for all records to zero. I have an update query where I am updating the CHANGE field with the difference between the main table's RATE field and the backup table's RATE field. For some reason, it is...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |