Go Back   Access World Forums > Apps and Windows > VB.NET

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-27-2014, 04:15 AM   #1
Tabrez
Newly Registered User
 
Join Date: May 2014
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Tabrez is on a distinguished road
How to insert date and time into access

I am using vb 2008, and i have successfully connected to access 2003 database using ado data control.
But I am unable to insert date and time and also retrieve it from data base.
The code which I use is

TO INSERT
recordset.fields("EntryDate").value= DateTimePicker.value

TO RETRIEVE
DateTimePicker.value=recordset.fields("EntryDate") .value


It gives me errors.
Any suggestions will be appreciated
Thank you in advance

Tabrez is offline   Reply With Quote
Old 05-27-2014, 04:30 AM   #2
sumox
Registered User
 
sumox's Avatar
 
Join Date: Sep 2013
Posts: 87
Thanks: 5
Thanked 9 Times in 9 Posts
sumox is on a distinguished road
Re: How to insert date and time into access

i know following shud work
Dim Kero As String
Kero= Date
... now insert you code bla bla for table update
this will set Kero as Today's Date
sumox is offline   Reply With Quote
Old 05-27-2014, 06:21 AM   #3
Tabrez
Newly Registered User
 
Join Date: May 2014
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Tabrez is on a distinguished road
Re: How to insert date and time into access

I tried using string operator as u suggested, but its giving two run time errors

1)Conversion from type DBnull to type DATE is not valid
2)Object reference is not set to the instance of an object

Tabrez is offline   Reply With Quote
Old 05-27-2014, 08:21 AM   #4
sumox
Registered User
 
sumox's Avatar
 
Join Date: Sep 2013
Posts: 87
Thanks: 5
Thanked 9 Times in 9 Posts
sumox is on a distinguished road
Re: How to insert date and time into access

pls. attach screen print of :
1. References library
2. Debug mode yellow line

in your next message
as if i am unable to assist you
any of AWF Members and Exp. will assist you.

thanks

K. sumox
sumox is offline   Reply With Quote
Old 05-27-2014, 08:22 AM   #5
sumox
Registered User
 
sumox's Avatar
 
Join Date: Sep 2013
Posts: 87
Thanks: 5
Thanked 9 Times in 9 Posts
sumox is on a distinguished road
Re: How to insert date and time into access

Mines worked successfully
dialog box appeared with same.
sumox is offline   Reply With Quote
Old 05-27-2014, 09:45 AM   #6
Tabrez
Newly Registered User
 
Join Date: May 2014
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
Tabrez is on a distinguished road
Re: How to insert date and time into access

Thank you for your response
Were you able to insert date into access.. if yes can you please give me the code what you used.

Tabrez is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Macro-shortcut to insert Date and Time Valery Macros 14 06-07-2017 12:52 AM
Insert Date/Time Into Table Using Command Button highwayman Forms 1 10-03-2012 05:32 AM
Insert query writing time to date field grahma_aiken Modules & VBA 3 04-18-2012 11:38 AM
Button to update field and insert date at the same time! djison Forms 6 02-01-2005 08:18 AM
I want to insert a time/date trigger JimJones Modules & VBA 1 06-10-2003 06:32 PM




All times are GMT -8. The time now is 11:38 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World