Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Memo field into Multiple EditBoxes

Status
Not open for further replies.

PaidtheUmpire

Programmer
Jan 4, 2004
105
AU
This is what I'm trying to do:

When a user changes the InvoiceClient ComboBox the following code runs, which will hopefully Collect the Clients Address (A memo field) and put each line into the EditBoxes (Addy1, Addy2 etc.)

Any ideas on how?


Code:
procedure TForm1.InvoiceClientChange(Sender: TObject);
var TheAddy : TMemo;
begin
ClientName.Text := InvoiceClient.Text;
With ClientJunk do begin
Close;
ClientJunk.Parameters.ParamByName('[Name]').Value := InvoiceClient.Text;
Open;
  try
    First;
//    TheAddy := Fields[2].AsMemo;
  finally
    Close;
  end;
end;
end;

Delphi, Delphi, Delphi. Oi! Oi! Oi!
 
hi

If it's not too late, I'd be tempted to change your DB table so you have the separate lines as separate fields in the database. This would be a lot easier as you could use DBEdit boxes. Validation of the address on input is also made hell of lot easier, checking for gaps in lines, country and postcode/zip codes etc. You can also apply mandatory field options too.

Otherwise, you need to go through the lines property and add each line to an edit box. The display could get messy if the addresses aren't in a consistent format.

lou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top