Lookup button not working

I apologise if this is a beginners question, but I have scoured the previous topics and the manual, help etc … I have created a form with a SourceTable of Campaign. This has a subform which displays a group of records in another table, which is linked to the Campaign table. I have the ‘No.’ and ‘Description’ from the Campaign table on the header of the mainform. All the properties on the form are the defaults. My problem is the lookup button on the ‘No.’ field. If I click it nothing happens. ‘F5’ pops up the listform ok. I dont have any code in the ‘No.’ OnLookup trigger on the form. What might be going on ?

Have You set up the Table Relation on the field ‘No.’?

i think table relation is set, that’s why it is showing look up button check Lookup form id property of the linked table property.

Hi Lars I hadnt. The screen displayed a lookup symbol all on its own, so I thought it had worked out the relationship itself. I have now tried setting the TableRelation and LookupformID to lookup the Campaign table in Campaign List, but the lookup button still doesnt do anything. It isnt really neccessary to have a lookup on this field, as the user gets the same functionality by using the ‘F5’ key. It’s just that the screen displayed a lookup button, so I felt I ought to make it work !! Perhaps I should just get rid of the lookup button instead. How could I do that ?

Property “Lookup” = FALSE gets rid of the lookup. But if the table Your field is related to have a LookupForm then all You need to do is to set the table relation and it works. You can look at this anywhere in standard Navision. It’s everywhere.

quote:


Originally posted by Lars Westman
Property “Lookup” = FALSE gets rid of the lookup. But if the table Your field is related to have a LookupForm then all You need to do is to set the table relation and it works. You can look at this anywhere in standard Navision. It’s everywhere.


Yes, but not on a mainform on the the primary key of the sourcetable … ?

The ‘Lookup’ property on the control is already ‘No’ (the default). I am really sorry, this must be something stupid I have done.

I have solved it. I remembered that I had changed the SourceTable property of the form from one table (with a tablerelation to the Campaign table) to another (the Campaign table itself). To cut a long story short, I deleted the controls from the form, added them again and everything looked as it should (no lookup button). Thanks to everone who took the time to think about this.