Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Mar 2008
    Location
    Frederick, Maryland, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Using A Memo Datatype in Recordset (Office 2003)

    I am running into a problem updating a word table using recordsets from Access; the datatype is a Memo datatype; Have no problem with the Text datatype fields. Is it impossible to update the word table with a Memo datatype. Is there an alternative that I could use? Below is a snippet of my code.

    Set rng = objApp.Selection.Range
    rng.Bold = False
    rng.Cells(1).Range.Text = myCount
    If Not IsNull(rst1!Type) Then
    rng.Cells(2).Range.Text = rst1!Type
    End If
    If Not IsNull(rst1!FurtherEvaluation) Then
    rng.Cells(6).Range.Text = Trim(rst1!FurtherEvaluation)
    End If
    If Not IsNull(rst1!RelatedItem) Then
    rng.Cells(7).Range.Text = rst1!RelatedItem
    End If
    If Not IsNull(rst1!UniqueItem) Then
    rng.Cells(8).Range.Text = rst1!UniqueItem
    rng.Cells(8).Range.Font.Size = 9
    End If
    If Not IsNull(rst1!Component) Then
    rng.Cells(3).Range.Text = rst1!Component
    End If
    If Not IsNull(rst1!AgingEffectOrMechanism) Then
    rng.Cells(4).Range.Text = rst1!AgingEffectOrMechanism
    End If
    If Not IsNull(rst1!AMP) Then
    rng.Cells(5).Range.Text = rst1!AMP
    End If

    rst1.MoveNext
    Loop

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Using A Memo Datatype in Recordset (Office 2003)

    Which field is the memo field here, and what exactly is the problem?
    Do you get an error message? If so, what does it say?
    Is the result different from what you expect? If so, in what way?
    Or does the target cell remain blank?

  3. #3
    New Lounger
    Join Date
    Mar 2008
    Location
    Frederick, Maryland, USA
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Using A Memo Datatype in Recordset (Office 2003)

    Hans, thanks for replying:

    I attached some screenshots of what the results are when I debug, and also the results when it is written to the word document. I don't get an error in the process; just unexpected results. Only with the memo data types.

    Please take a look...it is baffling to me. If use of the memo types in recordsets is a limitation, then it is an injustice without having a workaround.

    Thanks
    Dave J.
    Attached Files Attached Files

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Using A Memo Datatype in Recordset (Office 2003)

    There's something strange going on - in the screenshot of the VB editor, you can see that rst1!Component consists of some strange characters for ID = 1. So the problem is not with Word, but with either the Access table or with the recordset.

    I copied your code into the Northwind database and modified it to work with the tblEmployees table. The memNotes memo field was transferred correctly to cells in the Word table, confirming that it is possible to use a memo field to populate a cell in a Word table.

    Without seeing your database it's impossible to say what exactly causes the problem.

Posting Permissions

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