Microsoft Office Access 2013 Tutorial -Dealing with Read only Queries

5
Dealing with read-only queries j then press F5 or click Slide Show > From Beginning to start the course. In the message bar, click Enable Editing, If the videos in this course don’t play, you may need to download QuickTime or just switch to PowerPoint 2013 .

Transcript of Microsoft Office Access 2013 Tutorial -Dealing with Read only Queries

PowerPoint Presentation

Dealing with read-only queries

j

then press F5 or click Slide Show > From Beginning to start the course.

In the message bar, click Enable Editing,

If the videos in this course dont play, you may need to download QuickTime or just switch to PowerPoint 2013.

1

Dealing with read-only queries

Closed captions

1/1 videos

Read-only queries

Summary

Feedback

Help

3:16

Press F5 to start, Esc to stop

Hi. I'm Colin Wilcox, and I write training Courses for Access.

Today I want to talk to you about what you can do when you can't edit the results of a query.

And here's what the problem looks like.

You run a query, and you see a value you need to change, maybe a name, or maybe a price, but you can't.

So when that happens, switch your query to Design view, and make sure you're on the Design tab (that always helps),

and look at the type of query you're running.

If you're running a Crosstab, Union, Pass-Through, or Data Definition query, you can't change the results.

Now, with most Select queries you can change the results,

but sometimes you can't, and when that happens, again, switch the query to Design view, and look for the following things.

First off, make sure you're not dealing with a Totals query, because if you are, you can't edit the data.

The reason for that is that Totals queries aggregate data from multiple records inside the database,

and if you try and change that aggregated function,

Access doesn't know which of those source fields to update, and so it doesn't let you update anything.

Now at times, though, too, you may have a Select query that isn't a Totals query,

it doesn't have any aggregate functions in it, but you still can't change the data.

So when that happens, open the Properties sheet and take a look at a couple properties here.

Unique Values should be set to No, and if you see Snapshot down in the Recordset Type property, change that to Dynaset.

So I'll switch databases, and another thing to look for here is a subquery.

Now, you can see that I have a Select statement down here in the design grid, and that's a subquery.

So when you see that, change to SQL View, and here's what you don't want.

You can see that I've got a first Select statement here, that's my parent query,

and then on the same line I've got the second Select statement. That's the subquery.

Having those two on the same line means that you can't change your results.

So if you see that, then you have three solutions, basically.

You can clear the Show checkbox and hide that field from your results,

or you can replace that subquery with a domain aggregate function such as DMIN, DMAX, or whatever you need,

and the third solution is to move the subquery out of the first Select statement,

and again we'll go to SQL View, and we'll see what that looks like.

You can see that the subquery is now part of the Where clause,

and also, look at this, the subquery is running an aggregate function.

And when I run the query, you can see that even with the aggregate function there, I can change data. Pretty cool, huh?

So those are just some of the reasons that you can't edit data in a query,

and the course summary has links to information about a lot more.

So check those out, and thanks for watching.

1

2

3

4

Course summary

Help

Help

Course summary

Press F5 to start, Esc to stop

Course summaryDealing with read-only queries

Summary

Feedback

Help

1

2

3

4

Read-only queries

3:16

Check the query type

Make sure you arent trying to edit the data returned by a Crosstab, Union, Pass-Through or Data Definition query.

Look for aggregate functions

You cant edit the data returned by a Totals query, or a query that uses other aggregate functions such as MIN, MAX, or AVG.

Aggregate functions combine the values from multiple records, and if you try to change an aggregated value, Access doesnt know which source field to update, so it doesnt let you change anything.

Note, too, that in the video I said aggregated function but I meant aggregated value.

Check query properties

With the query in Design view, click Properties. Make sure the Unique Values property is set to No, and the Recordset Type property shows Dynaset. .

Look for subqueries

Specifically, look for subqueries that are part of the initial Select statement. For example:

SELECT [Order Date], (SELECT MAX([Order Date])

Adding the subquery to the parent query prevents you from editing data. Try these solutions:

In the query designer, clear the Show checkbox if you dont need to see the field in your result.

Replace the subquery with a domain aggregate function such as DMIN or DMAX.

Move the subquery out of the first Select statement.

See also

Edit data in a query

Access subquery techniques

Nest a query inside another query or in an expression by using a subquery

More training courses

Office Compatibility Pack

Check out more courses

Help

Course summary

Press F5 to start, Esc to stop

Rating and comments

Thank you for viewing this course!

How did we do? Please tell us what you think

Summary

Feedback

Help

1

2

3

4

Read-only queries

3:16

Help

Course summary

Press F5 to start, Esc to stop

Help

Summary

Feedback

Help

1

2

3

4

Using PowerPoints video controls

Point at the bottom edge of any video to start, stop, pause, or rewind. You drag to rewind.

Going places

You can go to any part of a course by clicking the thumbnails (light or shaded) below the video. You can also click the forward and back arrows, or press Page Up or Page Down.

Stopping a course

If youre viewing online, click your browsers Back button. If youre viewing offline, press Esc. If youre watching a video, press Esc once to stop the video, again to stop the course.

If you download a course and the videos dont play

Click Enable Editing if you see that button. If that doesnt work, you may have PowerPoint 2007 or earlier. If you do, you need to get the PowerPoint Viewer. If you have PowerPoint 2010, you need the QuickTime player, or you can upgrade to PowerPoint 2013.

Read-only queries

3:16