vb6 - Write all record met criteria line by line in Visual Basic 6 -


please me how list records meets criteria in text box (line line) below code retrieve first record .

note : tried enable multi lines in text box error appeared"can't assign read property"

any please amending beloe code

dim ifile integer dim sline string, snewtext string  ifile = freefile  open app.path & "\text1.txt" input #ifile while not eof(ifile)   line input #ifile, sline   if sline "*total interchange*"   text5.text = sline   end if loop close 

to find out if line containing string "total interchange" can use instr (don't worries, like works fine).

if instr(1, sline, "total interchange") > 0     text5.text = text5.text & sline & vbcrlf end if 

here reference , can test online:: vbscript instr function (it vbscript, not vb6 doesn't matter, identical)

regarding multiline property, should set in vb6 ide, not code.

to point:

please note shouldn't replace whole content of textbox appending new lines @ end keeping actual content of textbox , inserting line break. text5.text = text5.text & sline & vbcrlf does.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -