multiple line data entry into memo field  
Author Message
Jason Trolian





PostPosted: Visual FoxPro General, multiple line data entry into memo field Top

I am fairly new so please excuse any mistakes I make in posting my question.

Our company runs a debt collection software that has a foxpro 6 backend.

We run a telephone dialer that I am trying to report multiple contact attempts into the data base. Her is how I do it if I want to import one line of data:

tables used:

Destination table = coldbtr Destination Memo Field = dbtrref Record ID = dbtrno

Import dbf = data ( there are 5 fields included the first being my unique id field which = dbtrno I will refer to them as 1, 2, 3, 4, 5 (1 being the record id))

  • use data
  • index on 1 to data
  • select 0
  • use coldbtr
  • set relation to dbtrno into data
  • set filter to data.1 = dbtrno
  • replace all dbtrref with "DIALER RESULTS:"+chr(13)+data.2+" "+data.3+" "+data.4+" "+data.5+chr(13)+dbtrref

This gives me the results I need for one line of imported data. The problem I have is I don't know how to set it up to import multiple entries from one data file into my data base.

For example record # 999 in coldbtr has 5 entries from data. The way I am doing it above only imports the first line of data.

Thank you in advance for any and all help you can offer.

Jason Trolian



Visual FoxPro1  
 
 
CetinBasoz





PostPosted: Visual FoxPro General, multiple line data entry into memo field Top

Jason,

As I understand it:

-You're creating a filter for current dbtrno (which is unnecessary)
-Doing a replace "all" which is meaningless because all is currently scoped to current record due to filter
I'm not sure what is the purpose of final dbtrref on "replace" line.

There is nothing that loops in child (import.dbf) to collect those fields in your code. Try this:

set relation to dbtrno into data
scan
select data
set textmerge to m.lcData textmerge noshow
set textmerge on
\\Dialer results:
scan while data.1 == coldbtr.dbtrno && loop and collect data

\<<data.2>> <<data.3>> <<data.4>> <<data.5>>
endscan
set textmerge to
set textmerge off
select coldbtr
replace dbtrref with m.lcData
endscan


 
 
Jason Trolian





PostPosted: Visual FoxPro General, multiple line data entry into memo field Top

I'm not sure what is the purpose of final dbtrref on "replace" line.

If you don't add the final dbtrref on the replace line it only adds the "data" and overwrites all existing data. I will try your solution. Thank you for the response.