Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    121

    Unanswered: Updating a recordset Memo field

    All,
    I am trying to update a memo field thru vb using the following statement -

    If Frame111 = 1 Then
    rstStoreViolations!GeneralComments.Value = "Fine Jewelry Tote with blue seals, sent by DC was found at the Findlay RTV Processing Center."
    intTotal = intTotal + 1
    ElseIf Frame111 = 2 Then
    rstStoreViolations!GeneralComments.Value = "Fashion Jewelry Tote with blue zip ties, sent by DC was found at the Findlay RTV Processing Center."
    intTotal = intTotal + 1
    Else
    End If

    I get no error messages, but it is not updating that field, while all other fields are updated. Any suggestions?

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    How are you opening/setting the recordset? How are you closing it out? Are you using all the below commands?

    Code:
    rst.AddNew
    
    'do stuff
    
    rst.Update
    rst.Close
    Cheers!
    Me.Geek = True

  3. #3
    Join Date
    Dec 2005
    Posts
    121
    On Error GoTo Error_After_Update

    Dim intOptions As Integer
    Dim bytChoice As Byte
    Dim strDCNum As String
    Dim strMessage As String
    Dim dteDay As Date, dteToday As Date
    Dim dtePast As Date
    Dim strDteOk As String, strNoDC As String, strNoStoreNum As String, strValue As String
    Dim strNoTrailerOk As String, strNoCategory As String, strNoComments As String

    Dim dbs As Database, rstStoreViolations As Recordset
    Dim intTotal As Integer

    intTotal = 0

    Set dbs = CurrentDb
    Set rstStoreViolations = dbs.OpenRecordset("Violation Database", dbOpenTable)

    rstStoreViolations.AddNew
    rstStoreViolations!DCNum = Combo101
    rstStoreViolations!TKNum = fOSUserName
    rstStoreViolations!Date = VioDate
    rstStoreViolations!DateEntered = Date
    rstStoreViolations!StoreNum = Combo23
    rstStoreViolations!DistrictNum = DistrictNum
    rstStoreViolations!Territory = Territory
    rstStoreViolations!RegionNum = RegionNum
    rstStoreViolations!StoreName = StoreName
    rstStoreViolations!TrailerNum = TrailerNum
    rstStoreViolations!TransNum = TransNum
    rstStoreViolations!ServiceDC = "0811"
    rstStoreViolations!RecoveredCategory = Frame111
    rstStoreViolations!ToteNum = Text204
    rstStoreViolations!ValueFoundMerchandise = ValueFound

    If Frame111 = 1 Then
    rstStoreViolations!ToteComment = "Fine Jewelry Tote with blue seals sent by DC " & [Combo101].Value & " for store " & [Combo23].Value & " was found at the Findlay RTV Processing Center on trailer " & [TrailerNum].Value
    intTotal = intTotal + 1
    ElseIf Frame111 = 2 Then
    rstStoreViolations!ToteComment = "Fashion Jewelry Tote with blue zip ties sent by DC " & [Combo101].Value & " for store " & [Combo23].Value & " was found at the Findlay RTV Processing Center on trailer " & [TrailerNum].Value
    intTotal = intTotal + 1
    Else
    End If

    If Combo101 <> ServiceDC Then
    rstStoreViolations!DCError = 1
    Else
    rstStoreViolations!DCError = Null
    End If

    If Check167 <> False Then
    rstStoreViolations!TotesSealedImproperly = 1
    rstStoreViolations!TotesCategory = Frame168
    rstStoreViolations!ToteNum = ToteNumber
    intTotal = intTotal + 1
    Else
    rstStoreViolations!TotesSealedImproperly = Null
    End If

    rstStoreViolations!GeneralComments = Text130
    rstStoreViolations!TotalViolations = intTotal
    rstStoreViolations.Update

    Combo23.Enabled = True
    StoreName = Null
    DistrictNum = Null
    Territory = Null
    RegionNum = Null
    ServiceDC = Null
    Combo23 = Null
    Combo101 = Null
    VioDate = Null
    TrailerNum = Null
    TransNum = Null
    Check167 = False
    Text130 = Null
    Text204.Value = Null
    Check8.Value = False
    Frame111 = Null
    ValueFound = Null
    Combo101.Enabled = True
    Combo101.SetFocus

    Label169.Visible = False
    Label182.Visible = False
    Label184.Visible = False
    ToteNumber = Null
    ToteNumber.Visible = False
    Frame168.Visible = False
    Option171.Enabled = False
    Option173.Enabled = False
    Option175.Enabled = False
    Option177.Enabled = False
    Option179.Enabled = False
    Option188.Enabled = False
    Option200.Enabled = False
    Check167.Visible = False
    Label150.Visible = False
    Frame111.Visible = False
    Box74.Visible = False
    Label75.Visible = False
    ValueFound.Visible = False
    Text204.Visible = False

Posting Permissions

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