stevenblanc
Registered User.
- Local time
- Yesterday, 19:29
- Joined
- Jun 27, 2011
- Messages
- 103
Hi folks,
So I've been looking around both my code and online to see if I can figure out whats causing this little irritation.
I have a form with a tab control with a subform on each page. The subforms are continuous and display subtables to the master record held on the main form.
If the subtables contain data it displays fine and there are no errors when I close. However, for each subtable that has no data relevant to the current record the continuous form displays two blank records (the subforms are not enabled until an "edit" button is clicked and when closed I get the Primary key or index cannot be blank error. I am assuming this is focus related and has to do with focus being set on the first blank record field.
I tried creating a button in the detail section of the subforms and setting tab index set to 0 to set the focus there instead but I assume as long as its on the detail i'll get the same problem. I also tried an on load setfocus change but also doesnt work as it merely moves the focus after its already landed in the detail section.
Any other ideas?
UPDATE: I copied the form in the meantime to create an entry form. Once I click on the subform to enter the data I get the index/PK null error. Once I have filled the relevant data in I still get the same error when I try to click anywhere else. Not sure whats going on...
So I've been looking around both my code and online to see if I can figure out whats causing this little irritation.
I have a form with a tab control with a subform on each page. The subforms are continuous and display subtables to the master record held on the main form.
If the subtables contain data it displays fine and there are no errors when I close. However, for each subtable that has no data relevant to the current record the continuous form displays two blank records (the subforms are not enabled until an "edit" button is clicked and when closed I get the Primary key or index cannot be blank error. I am assuming this is focus related and has to do with focus being set on the first blank record field.
I tried creating a button in the detail section of the subforms and setting tab index set to 0 to set the focus there instead but I assume as long as its on the detail i'll get the same problem. I also tried an on load setfocus change but also doesnt work as it merely moves the focus after its already landed in the detail section.
Any other ideas?
UPDATE: I copied the form in the meantime to create an entry form. Once I click on the subform to enter the data I get the index/PK null error. Once I have filled the relevant data in I still get the same error when I try to click anywhere else. Not sure whats going on...
Last edited: