Focus on empty record in tablebox triggers OnInsertRecord()

kenyokenyo Member Posts: 40
Hi, my problem is , i open the form the form already filtered. If no record is found, an empty one is automatically created to set the focus on it. As soon as i try to click somewhere else it tries to insert that empty record into the table which results in an error ( thankfully ). If i set the property focusable to false this problem doesn't occur. But then the user can't select any records at all which they should. Editable is already false and i wonder , since the primary key is empty anyway why the OnInsert trigger is called at all :(

I've tried to exit the oninsert trigger but then the action gets canceled entirely so you can't click or do anything else.

Funnily enough if i touch the scroll bar, the focus is disabled without triggering anything and i can operate the form as intended.

Is there maybe an option that lets me change control properties on the fly ? or do you have any other solution ? Cheers.

P.S: side question: If no filter is set on the table it shows all records. Can i instead show no record at all? because i have a subform in this tab which shows the sales invoice lines according to the selected sales invoice header. but it shows the whole table if nothing is selected.

VPveqXe.png

Best Answer

Answers

  • kenyokenyo Member Posts: 40
    You're a lifesaver, thanks!
  • TallyHoTallyHo Member Posts: 417
    You're welcome!
Sign In or Register to comment.