Results 1 to 3 of 3
  1. #1
    Join Date
    May 2007
    Location
    Lost in Translation
    Posts
    946

    Unanswered: Access Not Transferring Date to Word

    I am having a problem with a particular machine, and no other in my Access Database.

    In my form, it takes fields and creates a report that then gets exported to a Word doc with the results from that. It saves this file on a network drive and functions normally for all other machines. The code passed is as followed for the date field on the doc;

    Code:
        Dim lnRecordID As Long
        Dim sql As String
        Dim rcd As ADODB.Recordset
        Set rcd = New ADODB.Recordset
        Dim bolPrintTTT As Boolean
        Me.txtPrintedDate = Now()
        
        stDocName = "rptTTT"
    ' open the report 1st time to print it out to default printer
        DoCmd.OpenReport stDocName
        
        bolPrintTTV = IIf(Me.txtTTTOption = 7, True, False)
        
        sql = "insert into tblTTTLookup (LOT_NUMBER, MATERIAL_NUMBER, CUSTOMER_VENDOR_ID, ORDER_NUMBER, PRINTED_DATE, USER_ID, TTV_EXIST) "
        sql = sql & " VALUES ('" & Me.txtLotNumber & "', '" & Me.txtProductNo & "', '" & Me.txtCustomerNo
        sql = sql & "', '" & Nz(Me.txtDeliveryNote, " ") & "', #" & Me.txtPrintedDate & "#, '" & txtUserName & "'," & bolPrintTTV & ")"
        Call runSqlCommand(sql)
        
        
        sql = "SELECT @@IDENTITY AS LastRecordId"
        rcd.Open sql, CurrentProject.Connection, Options:=adCmdText
            lnRecordID = rcd!Lastrecordid
        rcd.Close
        
        'open report again to print to word
        
        Set pf = New clsPrintToFit
        DoCmd.OpenReport stDocName, acViewPreview
        pf.ShowFileDialog = False
        pf.SaveFileName = strMainDocPath & lnRecordID & ".doc"
        pf.LoadMSWord = False
        pf.ExportToMSWord stDocName
        Set pf = Nothing
    What this does, is grab all the info it needs and creates one document TTT if it's of a certain status and TTT and TTV reports if it is of status 7. But both reports generated by this one specific machine has a ?Name as the result in the date field. The date is correct on this machine, and it seems to be machine specific and not user specific.

    Any idea what is causing this? I had this happen with another machine and just ghosted it with our standard image which corrected the problem... but I don't want to do this if I can figure out what is causing it in the first place. The user can create a regular word doc and F5 to paste the Now() date in just fine.
    "Passion rebuilds the world for the youth. It makes all things alive and significant. ~Ralph Waldo Emerson

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    In my opinion.....anything causing problems that is specific to only one computer always makes me think, "Does this computer have all the resources and references required to do the task".

    Try updating the Office or server package contained within that computer. Does it have the necessary rights and capabilities to receive the info provided?

    Does it have VISTA installed?

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  3. #3
    Join Date
    Nov 2007
    Posts
    1
    Have had some similar problems with 1 PC not showing dates properly from reports generated in access and exported to word the solution I found was to go to My Computer Control panel and check to see what the Regional Options on date format were. If they are not the same as the PC that created the report in Access they will not display properly. No guarantee but have a look .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •