Solved

Date data from VB to Access

Posted on 1998-06-09
1
121 Views
Last Modified: 2010-05-03
I retrieve the date from Access. The Access input mask for the date is 99/99/00;0. The date from Access is placed in a Msked Edit Box in VB.  It comes in correctly with no Mask set and the format set to d/M/yy.  When I change the date and send it back to Access I get a Data Conversion Error because it sends the date back as say, 9698 (June 6, 1998).  I was wondering how to send it back so that it will save it correctly.  Also, if I put a mask such as ##/##/## in so that the user has to enter 6 numbers for the date then the date does not necessarily come back from Access correctly after it is saved from VB. (ex: Access: 1/12/98-> VB: 11/28/9) How would I correct this also?
0
Comment
Question by:paulcarroll
1 Comment
 

Accepted Solution

by:
gkaziberdov earned 30 total points
ID: 1462968
First, check if the field in Access you are writing to is set up as a date field not a text field.
Second you could try '.FormattedText' property of the Masked Edit Box.
You should also make sure the the 'Include Literals' is checked in the properties.


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 VB code 9 103
VB error "Type mismatch" 2 50
Add a task in Outlook from access 11 35
VBA: Personal Macro Retain/Highlight/Remove values in a selected column 4 24
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now