RE: runtime error record is deleted



I want to split the fields to store in a table.

They dont seem that difficult. But maybe I'm doing it wrong. One of the
fields I have contains city , state and zip together in one cell (Excel).
I have corresponding fields, city,state and zip in my table. I am passing
the field to a function that splits the fields into an array :
dim array() as variant
array = split(inputfield,",")
rs.fields("city") = array(0)
rs.fields("state") = array(1)
rs.fields("zip") = array(2)
what do you think?
"Duane Hookom" wrote:

Why don't you give us some sample values (find the difficult, weird ones) and
tell us what you want to do with it? Do you have a field you want to store
this information in or do you want to split to display only?
--
Duane Hookom
Microsoft Access MVP


"trevi" wrote:

I have to convert some data from an xls spread***. Im calling a function I
created that takes in a field that contains city,state zip. In the function I
split them out into separate fields. I ran this and it tells me that the
"record is deleted". When I pull up the table, the first record has
"#deleted" in every field. I even went back into my function and tried to
only display a couple of fields, and I still get the same error.ll show the
query and the function ( how the recordset is opened). Maybe somebody can see
what I am doing wrong. Thanks in advance.

Query: SELECT splitname(flname,citystzip), first, last,
FROM ActiveApproach
Function:
Dim rs As ADODB.Recordset
Dim stzp() As String
arname = Split(name, ",")
lastname = arname(0)
firstname = arname(1)
Set rs = New ADODB.Recordset
rs.Open "activeapproach query", CurrentProject.connection, adOpenDynamic,
adLockOptimistic
rs.MoveFirst
MsgBox (rs.Fields("flname") & "name")

.


Loading