Semi Unique Combox Record Source on Continuous Form

Take a look at the demo on the right. This uses the trick of overlaying a textbox on the combobox. This gets rid of fields going blank. In the current format if you key down it goes blank as well as the scroll
 

Attachments

I was researching dynamic subform sizing and adapted a solution.



I ended up with this which I think is a great start. I think I will need code to resize the mainform for when it does not need to be so large.


In the context I will be using my application the subform usually holds 3-4 records rare that it would be 6 or more.


I am going to try the textbox workaround and also June7's approach which I was having trouble with last steps to make it work with new record.


Having 3 viable solutions is huge progress. Thanks again!
 

Attachments

textbox workaround and also June7's approach
I believe what I demoed is a version of her approach.

In your junction table you should go into the table properties and set
fkassetIDfk and fktaskID as required. Ensure no chance of an orphan.
I would also make a composite index on both of these fields ensuring that it is unique. That ensures you cannot assign the same asset to the same task.

I would add this so that you can type the first digit and the pulldown will go to a match
Code:
Private Sub cboAssetID_KeyDown(KeyCode As Integer, Shift As Integer)
  Me.cboAssetID.Dropdown
End Sub

I would get rid of the parent.requery in the after update of the combo. Not sure the purpose, and as written will always send you back to the first task.

I do not know why, but getting rid of the scrollbars fixed a lot of the issues.
 
The public function I adapted had references that were bit off. I was trying to resize the subform after entering new record.






I fixed the references and seems better.


Moving focus onto mainform after entering also helped reduce vanishng acts (specifically if mainform record changed while subform combo had focus).




The resizing Post I referenced:


showthread.php?t=93858
 

Attachments

Users who are viewing this thread

Back
Top Bottom