From based on a query that opens to a new blank record

Access 2007
I have a form that is based on a query.  It is the first time I've used this method.  But it does not allow for creating new records.

When I create a form based on a table, in the On Load property I use this
Private Sub Form_Load()
Me.DataEntry = True
DoCmd.Maximize
End Sub

to open with a new blank record.

Is there something different required when a form is based on a query?

Thanks,
Brooks
gbnortonAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Dale FyeConnect With a Mentor Commented:
It may be that the query is not updateable.  Open the query by itself and attempt to change or add a record.  If you get at "this query is not updateable" message, then consult Allen Browne's website (http://www.allenbrowne.com/ser-61.html) for a discussion of some of the causes of this.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
You first need to be sure that the query itself is Updatable.  If it's based on more than one table, then it may not be.  Run the query by itself and see if you can update and/or add a record.

mx
0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
Normally I only have a single table in the query for the form's record source.

 For example: If you havea  look up table then you can use a combo box to display the related data without the need to add the look up table to the form's query.

If you have a one-to-many relationship then  I would not add the table to the form's query. I would use a sub form for the many side's table

This might also help:
Why is my query read-only?
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
gbnortonAuthor Commented:
I ran the query by itself and could not add or edit a record.

In the query I have two expressions.  One for calculating a total and one for an average.

From Allen Browne's article that seems the reason.

It is a single table.

0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
"In the query I have two expressions."
Is this a Group By query then? If so, that is ... the reason. No can do.

mx
0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
gbnorton, as mx stated you can not use a Totaling query and it be updatable. It may be possible to get eh total use want by using a sub query and the query still be updatable.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.