Import to Access errors out

  • Thread starter Thread starter bear
  • Start date Start date
Status
Not open for further replies.
Hello Sue,

After all it was Access database field type issue.

Thanks for your help

suemvp wrote on Thu, 07 January 2010 18:36
> I disagree. If you set a database field to a certain value, but read out a
> different value from the same field, then the cause would seem to lie in the
> database. Nothing else has touched the data. It's certainly not an Outlook
> issue. I have no idea what in Access could cause this other than having the
> wrong data type for the field. If you pursuse this on an Access forum, which
> I would recommend, be sure to reduce the code you share down to a specific
> snippet that deals just with the raw vaues, not with Outlook properties.
> Mentioning Outlook will only distract the Access experts from your real
> issue.

> Also, there is no need to use both CSng() and CDbl() on the value that
> DateDiff returns. Use whichever is more appropriate to your expected data.
> > Sue Mosher
> > >

> "bear" <swin_1234[at]yahoo[dot]com> wrote in message
> news:uvHJgB$jKHA.5020@TK2MSFTNGP02.phx.gbl...
> > Hello Sue,
> > I was trying to get certain format, but you right, I do not need it:
> > Set rst = dbs.OpenRecordset("Form")
> > rst.AddNew
> > Set ups = con.UserProperties
> > TotalM = DateDiff("n", ups.Find("Start1"), ups.Find("End2"))
> > TotalH = CSng(TotalM / 60)
> > rst!LengthofAppt = CDbl(TotalH)
> > If CDbl(TotalH) is 4.683333, rst!LengthofAppt is rounded up to 5.
> > Anywhere else in the code rst! value can be anything such 0.003 or
> > 111#$23. I do not think it has to do with Access as fields in the table
> > are all the same.
> > suemvp wrote on Mon, 04 January 2010 21:09
> >> I don't understand why you're using Format() at all in this scenario. If
> >> you want to round the hour value to two decimal points, just use Round().
> >
> >> In any case, if the database isn't accepting or reporting the correct
> >> value, that sounds like an Access issue, not an Outlook issue. I can't
> >> help you with that.
> >
> >> "bear" <swin_1234[at]yahoo[dot]com> wrote in message
> >> news:OmamphYjKHA.2132@TK2MSFTNGP05.phx.gbl...
> >> > Hello Sue,
> >> >> > My Access table takes in Numeric value in a fixed format 0.000.
> >> > I tied both methods, or combination of, you suggested, still no luck.
> >> > For rst!LengthofAppt = CDbl(TotalH), even if CDbl(TotalH) 5.01,
> >> > rst!LengthofAppt is 5.
> >> > A
> >> >> > Set ups = con.UserProperties
> >> > TotalM = DateDiff("n", ups.Find("Start1"),
> >> > ups.Find("End2"))
> >> > TotalH = CSng(Format((TotalM / 60), "#,##0.00"))
> >> > rst!LengthofAppt = CDbl(TotalH)
> >> >> > B
> >> >> > Set ups = con.UserProperties
> >> > TotalM = DateDiff("n", ups.Find("Start1"),
> >> > ups.Find("End2"))
> >> > TotalH = CSng(Format((TotalM / 60), "#,##0.00"))
> >> > rst!LengthofAppt = CSng(TotalH)
> >> >> >> > suemvp wrote on Fri, 01 January 2010 13:16
> >> >> Maybe because LengthofAppt is set up in the database as an Integer
> >> >> field? In any case, Format() returns a string, so if LengthofAppt is a
> >> >> numeric field of any kind, you should use a converter method like
> >> >> CDbl() or CSng() to convert that string into a numeric value.
> >> >
> >> >> "bear" <swin_1234[at]yahoo[dot]com> wrote in message
> >> >> news:OiR8oaniKHA.1652@TK2MSFTNGP05.phx.gbl...
> >> >> > In this example:
> >> >> > Set rst = dbs.OpenRecordset("Form")
> >> >> > rst.AddNew
> >> >> > Set ups = con.UserProperties
> >> >> > TotalM = DateDiff("n", ups.Find("Start1"),
> >> >> > ups.Find("End2"))
> >> >> > TotalH = Format((TotalM / 60), "#,##0.00")
> >> >> > rst!LengthofAppt = TotalH
> >> >> >> >> >> >> > If TotalH is 1.02, why does rst!LengthofAppt becomes 1, instead of
> >> >> > 1.02?
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
W Outlook 365 File access denied attempting to import .pst Using Outlook 6
Z Import Tasks from Access Using VBA including User Defined Fields Outlook VBA and Custom Forms 0
Hudas Import Outlook Emails(Inbox) to MS Access as Attachment Using Outlook 1
S Import pst file into 365 desktop and have it sync one Using Outlook.com accounts in Outlook 2
C New pc, new outlook, is it possible to import auto-complete emailaddress Using Outlook 5
T How to Export & Import GMAIL Contacts into Outlook 2021 ? Using Outlook 4
S Import PST to Office 365 Using Outlook 1
D ISOmacro to extract active mail senders name and email, CC, Subject line, and filename of attachments and import them into premade excel spread sheet Outlook VBA and Custom Forms 2
J How to import many msg into different public folders in Outlook Outlook VBA and Custom Forms 7
K Disabling import/export button to restrict PST creation Using Outlook 3
I Outlook 365 - import/attach PST file that used POP3 Using Outlook.com accounts in Outlook 0
M Export-Import .pst file problems Using Outlook 2
N .pst archive from work will not open/import on Microsoft 365 Exchange Server Administration 0
M PST import from Outlook 2007 to 2010 - Address Book contacts all in 1 group Using Outlook 4
CWM330 Import Exchange Server Administration 1
R PST->Outlook.com (Import vs Drag-n-Drop methods Using Outlook.com accounts in Outlook 2
DoctorJellybean Import accounts\files Using Outlook 1
S Import contacts to a shared mailbox Outlook VBA and Custom Forms 2
P Import Categories from Outlook 2003 Using Outlook 8
avant-guvnor Import csv problem Using Outlook 7
T Outlook 2016 CSV Translator Import Error Using Outlook 6
Rupert Dragwater How to import contact list Using Outlook 15
C Import Outlook 2016 contacts into to: field Using Outlook 1
P Import an .ics file to a specific calendar Using Outlook 4
L Need to import multiple Outlook files to Office 365 Account Using Outlook 4
R ost file import Using Outlook 2
T Outlook Calendar 2016 import Excel Using Outlook 1
I Import Office theme .thmx Using Outlook 4
Diane Poremsky Batch Import Photos into Outlook Contacts Using Outlook 0
Diane Poremsky Can't import CSV or move Outlook items into EAS Accounts Using Outlook 0
Diane Poremsky How to Import Appointments into a Group Calendar Using Outlook 0
B Import Excel Text into Outlook Calender Using Outlook 4
M How to Import YES/NO Checkboxes? BCM (Business Contact Manager) 0
J Converted .ost to .pst: Want to Import and Reconnect with IMAP Email Account Using Outlook 2
GregS Import from Outlook.com .ost to IMAP .pst? Using Outlook 3
Q Outlook 2016\365 export specific rules to import in another system Exchange Server Administration 1
Diane Poremsky Macro to Bulk Import Contacts and vCards into Outlook Using Outlook 0
Diane Poremsky Import Images into the Active Directory Using Outlook 0
M convert/import a customized record into the default "Account" record BCM (Business Contact Manager) 0
Diane Poremsky Macro to Bulk Import vCards into Outlook Using Outlook 0
e_a_g_l_e_p_i question about saving my .pst so I can import it to my Outlook after I build a new system Using Outlook 10
V Import from Outlook 2013 ost file? Using Outlook 2
ogodt Change Default contact form and import from Excel 2010 Using Outlook 1
E Want to Import Outlook 2003 pst files to later version Using Outlook 6
A Does Outlook import Gmail Archive? Using Outlook 1
E PDF Import Using Outlook 1
B Problem with import Excel BCM (Business Contact Manager) 1
bhogesh How to import .htm saved mail to outlook Using Outlook 3
J Easy way to re-import Gmail folders/labels into Outlook? Using Outlook 9
J Opening/Archiving/Import/Export PST files Using Outlook 4

Similar threads

Back
Top