Good guess, but in this case it was a 160. Anyone have a clue what a
Chr(160) is, or even better, how she got it in there in the first place?
(Data was entered in Excel, then imported, and yes, I went back to the
original spreadsheet and confirmed it was that way in there!)
Hmmm... It just occurred to me that a 160 is a space char (32) with the
highest order bit turned on. There must be some sort of a connection there.
But, I'm bewildered.
Private Sub Randy()
Dim I As Integer, S As String
S = DLookup("PartNum", "tblManuals", "ManualID=189")
Debug.Print S
For I = 1 To Len(S)
Debug.Print I; Asc(Mid(S, I, 1))
Next I
End Sub
93-027192 - NX2
1 57
2 51
3 45
4 48
5 50
6 55
7 49
8 57
9 50
10 32
11 45
12 32
13 78
14 88
15 50
16 32
17 32
18 160
19 32
"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> wrote in message
news:4tYHc.275$6FN.54@news04.bloor.is.net.cable.ro gers.com...[color=blue]
> Check for the presence of a Null (Chr(0)).
>
> --
> Doug Steele, Microsoft Access MVP
>
http://I.Am/DougSteele
> (no e-mails, please!)
>
>
>
> "Randy Harris" <randy@SpamFree.com> wrote in message
> news:7oXHc.688$Vi5.76@newssvr31.news.prodigy.com.. .[color=green]
> > I am quite possibly losing my mind. Trim appears to be working[/color][/color]
perfectly.[color=blue][color=green]
> > Except for on one record. Naturally, the record I was checking to see[/color][/color]
if[color=blue][color=green]
> > Trim worked or not. It won't Trim that one record, it must have some[/color]
> weird[color=green]
> > character in it or something.
> >
> > Thanks to you both for your help.
> > Randy
> >
> >
> > "rpnman" <res0zspl@verizon.net> wrote in message
> > news:DtWHc.39819$Xq4.21892@nwrddc02.gnilink.net...[color=darkred]
> > > The following worked for me:
> > >
> > > In an update query based solely on the table in question put
> > > TRIM:(TableName.FieldName) in the update to field.
> > >
> > > For tblTest(ID, name), in SQL view, this yields
> > >
> > > UPDATE tblTest SET tblTest.name = Trim([tblTest].[Name]);
> > >
> > >
> > >
> > > --
> > > ROGER NEYMAN
> > >
> > > "Randy Harris" <randy@SpamFree.com> wrote in message
> > > news:e2VHc.35150$eH1.16645896@newssvr28.news.prodi gy.com...
> > > > "Randy Harris" <randy@SpamFree.com> wrote in message
> > > > news:rsUHc.35137$eH1.16639931@newssvr28.news.prodi gy.com...
> > > > >
> > > > > "PC Datasheet" <nospam@nospam.spam> wrote in message
> > > > > news:b0SHc.9068$sD4.8409@newsread3.news.atl.earthl ink.net...
> > > > > > Randy,
> > > > > >
> > > > > > Create a new field in your query and enter this expression:
> > > > > > MyUpdateField:Trim([partnum])
> > > > > >
> > > > > > Then change the query to an Update Query and enter this[/color][/color][/color]
expression[color=blue][color=green][color=darkred]
> > > where
> > > > > it says
> > > > > > Update To in the PartNum field:
> > > > > > MyUpDateField
> > > > >
> > > > > Perfect. Should have thought of that myself. Thanks!
> > > >
> > > > Well, I spoke a bit too soon. I still have a problem. It doesn't[/color][/color]
> look[color=green]
> > as[color=darkred]
> > > > though the Trim functions work in the A2K query grid. No error,[/color][/color][/color]
they[color=blue][color=green]
> > just[color=darkred]
> > > > don't trim the spaces. I tried the MyUpdateField:Trim([partnum]) as[/color][/color]
> an[color=green][color=darkred]
> > > > Update query, a MakeTable query and as a Select query. Trim just[/color][/color]
> plain[color=green][color=darkred]
> > > > doesn't work. Surprising.
> > > >
> > > >
> > > > > > PC Datasheet
> > > > > > Your Resource For Help With Access, Excel And Word Applications
> > > > > >
resource@pcdatasheet.com
> > > > > >
www.pcdatasheet.com
> > > > > >
> > > > > >
> > > > > > "Randy Harris" <randy@SpamFree.com> wrote in message
> > > > > > news:aUMHc.671$Np4.478@newssvr31.news.prodigy.com. ..
> > > > > > > I imported records into a table, later found out that many of[/color][/color]
> them[color=green][color=darkred]
> > > had
> > > > > > > trailing spaces in one of the fields. If I'd caught it[/color][/color][/color]
sooner,[color=blue]
> I[color=green][color=darkred]
> > > > could
> > > > > have
> > > > > > > trimmed the spaces before the import.
> > > > > > >
> > > > > > > This wouldn't work (nothing changed):
> > > > > > > UPDATE tblManuals SET tblManuals.PARTNUM = Trim([partnum]);
> > > > > > >
> > > > > > > Would someone please tell me how to do an update query that[/color][/color][/color]
will[color=blue][color=green][color=darkred]
> > > trim
> > > > > the
> > > > > > > spaces?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]