Don't Add New Record at Load

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

Guest

I have a user form that is filtered based on some selections they make in a
few combo boxes. So when the form loads it comes up blank because they
haven't entered there options to filter on. This works OK, however the
problem is that this blank form allows them to enter new records. I want the
form to be blank on load but not allow the user to enter new records. Any
suggestions?

Thanks!
 
Put the following code in the form's Current event:

me.AllowAdditions = Not IsNull(MyTextBox)

where MyTextBox is the name of a control on your form which will contain
data when a record is available. This will set the AllowAdditions property
to false if there is no data, and to true if there is data.

If you are only using the form to edit existing records (are you allowing
this form to be used to enter a new record if there are entries in the
filter combo-boxes?), you could simply set AllowAddition to No in the form's
property sheet.

HTH,

Rob
 
Back
Top