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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie Q. on Table providing a null value to end loop 1

Status
Not open for further replies.

schultz2146

Technical User
Jul 22, 2007
2
UA
All, first time user of this site... have searched all strings relating to tables and null values and could not find the simple answer that is eluding me. Below is a sniped from a formshow:

Begin
repeat
UserNameComboBox.Items.Add(RegForm.UserTableUserName.Text);
RegForm.UserTable.Next;
until RegForm.UserTableUserName.text = ''
end

As u can see I wanted to add all user names from a table into a combobox at runtime.

What has eluded me is the string
*** until RegForm.UserTableUserName.Text = ''
I've tried value <> null and ~ 10 different derivatives of above to no joy.

All I want it to do is produce a true statement. Do loop until end of file.... Any thoughts?
 
try
Code:
with Table do
begin
  DisableControls;
  try
    First;
    while not Eof do
    begin
     { Process each record here }
     Next;
    end;
  finally
    EnableControls;
  end;
end;

Aaron
 
with disablecontrols you cant access the dbeditbox.text so do it like this

Code:
UserNameComboBox.Items.Add(UserTable.fieldbyname('UserName').asstring);

Aaron
 
Didn't even think to use the EoF... Thank you for your help.

Richard
 
Although not helpful for looping, the following code thingy lets you know when a field value is null:

RegForm.UserTableUserName.IsNull


GIS Programmer
City of Orem, UT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top