Solved

Microsoft Access 2007 - continuous form

Posted on 2010-09-20
6
1,037 Views
Last Modified: 2013-11-28
I have a continuous form that displays my recordset.  I want the user to be able to update one of the fields but I don't want the user to be able to add a new record from this form.  So I open the form using acEdit to allow the records to be updated but it also has the new empty row with an "*" for adding the next record.

      DoCmd.OpenForm "DAFTracking", acNormal, , strWhere, acEdit, acNormal

Is there a way to "turn off" the empty row at the end of the detail section of my continuous form?  Or make it invisible?  I tried setting "Allow Additions" form property to No but that didn't seem to change anything.  The empty row was still there.

Thank you for the help.
Helen
0
Comment
Question by:greenprg
  • 3
  • 2
6 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 33721099
"I tried setting "Allow Additions" form property to No but that didn't seem to change anything.  The empty row was still there."

It should.

Try this instead:

Set the Form Allow Edits to Yes, Allow Additions to No, then:

DoCmd.OpenForm "DAFTracking", acNormal, , strWhere

mx
0
 
LVL 30

Expert Comment

by:hnasr
ID: 33721941
The open to edit, shows the form to show with data and allows for entry as well.
Setting the allow additions to no, stops the additions as DatabaseMX suggested.
0
 

Author Comment

by:greenprg
ID: 33722231
Wow!  It works.  I already had the Allow Edits set to Yes and Allow Additions set to No.  All I changed was the DoCmd.OpenForm without the last 2 parameters and.......very cool.  Good thing I asked.  Who know how long I would have been searching around for that one.

Thank you.
Helen
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Closing Comment

by:greenprg
ID: 33722235
Thanks for the quick response.
Helen
0
 
LVL 75
ID: 33722278
You are welcome.  Actually, I think your problem was here:

DoCmd.OpenForm "DAFTracking", acNormal, , strWhere, acEdit, acNormal
                                                                                           ^^^ and  ^^^^^^^^^

You have acNormal twice, but the argument after acEdit is for WindowMode; however, the definition of acEdit is:

"acFormEdit The user can edit existing records and add new records."

So, that's why the New Record indicator was showing, because the argument in that position ... 'DataMode' ... overrides the Form settings of AllowEdit, AllowAdditions, etc.

mx
0
 

Author Comment

by:greenprg
ID: 33722287
Thanks.  Yes, I learned something new and useful....and now I can clean up some more of my code.  Learning as you go in my case means, going back and "optimizing" older code.  :-)

Helen
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question