Access 2003. My form starts with a list box, populated via code:
[blue]Me!BOM_RollUp_sub.Form![listBOM].RowSourceType _
= "Table/Query"
Me!BOM_RollUp_sub.Form![listBOM].RowSource _
= "SELECT etc ..."[/blue]
Selecting one of its records populates the rest of the form. I want the topmost of the listbox records to be the default selection. For weeks I have searched for a way to set a default selection ... TekTips suggested adding:
[blue]Me!BOM_RollUp_sub.Form![listBOM].Selected(0) = True[/blue]
This produces what I want. But when I close the form, the app crashes: [red]Microsoft Access has encountered a problem and must close. We are sorry, privacy statement, etc. ... [/red]
If I comment out my new line of code, no problem. Now why would this single line of code, upon form close, crash the app ?!
_______________________________
Never confuse movement with action -- E. Hemingway
_______________________________
[blue]Me!BOM_RollUp_sub.Form![listBOM].RowSourceType _
= "Table/Query"
Me!BOM_RollUp_sub.Form![listBOM].RowSource _
= "SELECT etc ..."[/blue]
Selecting one of its records populates the rest of the form. I want the topmost of the listbox records to be the default selection. For weeks I have searched for a way to set a default selection ... TekTips suggested adding:
[blue]Me!BOM_RollUp_sub.Form![listBOM].Selected(0) = True[/blue]
This produces what I want. But when I close the form, the app crashes: [red]Microsoft Access has encountered a problem and must close. We are sorry, privacy statement, etc. ... [/red]
If I comment out my new line of code, no problem. Now why would this single line of code, upon form close, crash the app ?!
_______________________________
Never confuse movement with action -- E. Hemingway
_______________________________