Semi Unique Combox Record Source on Continuous Form (1 Viewer)

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:45
Joined
May 21, 2018
Messages
8,463
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

  • SampleCascadeCombo.mdb
    380 KB · Views: 146

Briguy01

Registered User.
Local time
Today, 11:45
Joined
Jan 20, 2019
Messages
9
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

  • Sample_CJ_Resize.mdb
    340 KB · Views: 102

MajP

You've got your good things, and you've got mine.
Local time
Today, 11:45
Joined
May 21, 2018
Messages
8,463
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.
 

Briguy01

Registered User.
Local time
Today, 11:45
Joined
Jan 20, 2019
Messages
9
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

  • Sample_CJ_Resize_1_2.mdb
    344 KB · Views: 109

Users who are viewing this thread

Top Bottom