Force a form to load with no data preloaded in.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form which contains a combo box at the top. The idea is the user
types the order number they require in the combo box and this order's details
are loaded.

But whenever I open the form, the last order's details are still displayed
on the form. How can I force the form to not display any data in the fields
upon the first load. The reason I need to do this as certain users often
forget that they need to re-enter the order number and start to modify the
details which are remembered from the previous session - but obviously this
data is incorrect, so I want to force them to have re-enter the order ID.
 
Use a query as the form's RecordSource. That query should have a criterion
expression for the field being "selected" in the combo box to read the
form's combo box:
[Forms]![TheFormName]![TheComboBoxName]

Then, on the AfterUpdate event of the combo box, do a requery of the form:

Private Sub TheComboBoxName_AfterUpdate()
Me.Requery
End Sub
 
Back
Top