Open read-only form blank

M

Mishanya

I've been reading a lot of threads on the issue, but still have no solution.
I want the form to open blank so the user can search records with unbound
cboSelectors in the Header, but it won't allow to change or add records, so
the "blank" record can't be "new" record.

Using On Open event procedure:
Me.Filter = "(False)"
Me.FilterOn = True

opens the form on "new" record in Add-one-record-only mode and disables the
cboSelectors.

Using the Load event procedure:
If Not Me.NewRecord Then
RunCommand acCmdRecordsGoToNew
End If

lets the cboSelectorswork, but opens the form on "new record in Add-enabled
mode.

Playing with AllowAdditions, AllowDeletions, AllowEdits and DataEntry
properties has not let me any further. I still can't find "Read only - open
blank (not on new record) - search with cboSelectors" mode.

I'll appreciate any help.
 
J

Jeanette Cunningham

Hi Mishanya,
there is a sample search form that does that on this site:
http://allenbrowne.com/ser-62.html

It is set up to show all records when it opens, but the code has a
commented out section to use if you want it to open blank.
It also explains why the search form needs to have its Allow Additions set
to true, and how to stop users from adding new records.
Well worth a look.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top