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

DBLookupCombo box misbehaving

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a crappy program that I am maintaining. The person who did the programming came from an RPG background and had no OO concepts or understanding when he built this program.

Anyways there's this piece of code that is supposed to set the DBLookupCombo box to the state of NM when the field is entered:

Code:
with DModule.TbStateCodes do
  begin
    EditKey;
    FieldByName('STATCD').AsString := 'NM';
    GotoKey;
  end;

now this code worked before i moved the component. All I did was move the component from one location on the form to another and now this doesn't work! The state is no longer pre filled in on the form when the user enters the field. I can step through the code and verify that it's being run, but it doesn't appear to do anything.....

Any suggestions?

Thanks!

Leslie
 
if you moved the combo then make sure you relink its datasource and field properties.

Aaron
 
really? moving it from one part of a form to another part of the same form could cause the link to drop?

I'll check it....

thanks!

leslie
 
I figured it out....there was another field that on it's onexit event that was actually setting the field value...all worked out now!

thanks!
leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top