blank NON-EDITABLE form

R

Roachina

Hello all,

I currently have a form that opens up displaying the first record in my
table (in read-only mode). I would like it to open up blank and NON-EDITABLE
until one of the command buttons (add or find) is clicked. Is there a way
to accomplish this?

Roachina
 
G

Graham Mandeno

Hi Roachina

Try setting AllowEdits to No and DataEntry to Yes in form design, so these
are the defaults when the form opens.

Then, when you click the Add button, set Me.AllowEdits = True.

For the Find button, set Me.AllowEdits = True and Me.DataEntry = False.
 
R

Roachina

Hi Graham,

Well...that partly worked for me. My form now opens up blank, but I am able
to enter data into the fields before clicking a comman button. Any ideas how
I can fix this so that data can't be entered until hitting a command button?

I appreciate your time.

Graham Mandeno said:
Hi Roachina

Try setting AllowEdits to No and DataEntry to Yes in form design, so these
are the defaults when the form opens.

Then, when you click the Add button, set Me.AllowEdits = True.

For the Find button, set Me.AllowEdits = True and Me.DataEntry = False.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roachina said:
Hello all,

I currently have a form that opens up displaying the first record in my
table (in read-only mode). I would like it to open up blank and
NON-EDITABLE
until one of the command buttons (add or find) is clicked. Is there a
way
to accomplish this?

Roachina
 
G

Graham Mandeno

Hi Roachina

I'm guessing the default DataEntry value is overriding the AllowEdits.

Set these two properties to the desired values in your Form_Load event
procedure:

Me.DataEntry = True
Me.AllowEdits = False
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roachina said:
Hi Graham,

Well...that partly worked for me. My form now opens up blank, but I am
able
to enter data into the fields before clicking a comman button. Any ideas
how
I can fix this so that data can't be entered until hitting a command
button?

I appreciate your time.

Graham Mandeno said:
Hi Roachina

Try setting AllowEdits to No and DataEntry to Yes in form design, so
these
are the defaults when the form opens.

Then, when you click the Add button, set Me.AllowEdits = True.

For the Find button, set Me.AllowEdits = True and Me.DataEntry = False.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand

Roachina said:
Hello all,

I currently have a form that opens up displaying the first record in my
table (in read-only mode). I would like it to open up blank and
NON-EDITABLE
until one of the command buttons (add or find) is clicked. Is there a
way
to accomplish this?

Roachina
 
G

Graham Mandeno

Hi Linq

Well, fancy that! I've been using Access since 1992 and I never knew the
AllowEdits property was overridden by the NewRecord state <g>

Roachina, I agree with Linq that a much better method would be to open a
small unbound dialog form with your two buttons on, then open the form in
the required mode from there. You could also add record selection fields to
find the desired record using a filter if the "Edit" option was chosen.

If you are still dead set on the method you are already using, than you can
lock and unlock all the editable controls on the form as required. Allen
Browne has a nifty function to do just that - take a look at
http://allenbrowne.com/ser-56.html
 
R

Roachina

Hi Graham and Linq,

I'm still pretty new at Access, so I REALLY appreciate your help.

I like the alternative of actually having a blank record and going to that
record in Form_Load, with Me.AllowEdits = False.

I didn't know how to save a blank record to my table, so what I did was I
added an extra column which I added the word "Blank" into. This column will
NOT be a field on my form. So, this blank record will be the only one with
something entered into that column.

So, the next question is: How do I get the form to initially open to that
"blank" record?

Thank you!
Rochelle
 
G

Graham Mandeno

Hi Roachina

I have to say I don't like the blank record idea. I think it's asking for
trouble down the track - for example you will always need to remember to
filter it out of reports etc.

See my last post for alternative suggestions - a dialog form to pre-search
for the desired record or locking all the editable controls.

Another possibility that just occurred to me is to make the entire detail
section of your form invisible when the form loads:

Me.Section(acDetail).Visible = False

Of course, your buttons and any search/selection controls would need to be
in the header or footer of the form. When required, after going to the new
record or finding an existing one, you can make the section visible again.

As Linq says in his signature, "There's ALWAYS more than one way to skin a
cat!"
 
R

Roachina

Sorry I took so long to respond, but I really wanted to thank you for your
knowledgable input and suggestions.

I see how the blank record idea could cause a problem, particularly if I
wasn't around anymore, for some reason, and the next person didn't know about
it.

I went with locking and unlocking controls as needed to make my blank
non-editable form. It works great! Thank you so much for all your help.

Rochelle

Graham Mandeno said:
Hi Roachina

I have to say I don't like the blank record idea. I think it's asking for
trouble down the track - for example you will always need to remember to
filter it out of reports etc.

See my last post for alternative suggestions - a dialog form to pre-search
for the desired record or locking all the editable controls.

Another possibility that just occurred to me is to make the entire detail
section of your form invisible when the form loads:

Me.Section(acDetail).Visible = False

Of course, your buttons and any search/selection controls would need to be
in the header or footer of the form. When required, after going to the new
record or finding an existing one, you can make the section visible again.

As Linq says in his signature, "There's ALWAYS more than one way to skin a
cat!"
--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand


Roachina said:
Hi Graham and Linq,

I'm still pretty new at Access, so I REALLY appreciate your help.

I like the alternative of actually having a blank record and going to that
record in Form_Load, with Me.AllowEdits = False.

I didn't know how to save a blank record to my table, so what I did was I
added an extra column which I added the word "Blank" into. This column
will
NOT be a field on my form. So, this blank record will be the only one
with
something entered into that column.

So, the next question is: How do I get the form to initially open to that
"blank" record?

Thank you!
Rochelle
 

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