Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

access+course+training - access queries

Forum home » Delegate support and help forum » Microsoft Access Training and help » access+course+training - Access queries

access+course+training - Access queries

ResolvedVersion Standard

Lucy has attended:
Excel Intermediate course
Excel Advanced course
Access Introduction course
Access Intermediate course

Access queries

When I try to run and create a query to pull out all of my stockists who we want to sell to (from a Status--- 'want' table), it returns no results. The query doesn't say it has any problems though, what am I doing wrong?

thanks,
Lucy

RE: Access queries

Hi Lucy

Please will you click on VIEW and then SQL. If you send me that code ni a reply to this post, I will take a look for you.

Regards

Richard

RE: Access queries

SELECT Retailer.RetailerID, Retailer.Name, Retailer.Status
FROM Retailer INNER JOIN Branch ON Retailer.RetailerID = Branch.RetailerID
WHERE (((Retailer.Status)=[the Status]));


Hi Richard,
there it is, thank you-

LR

RE: Access queries

SELECT Retailer.RetailerID, Retailer.Name, Retailer.Status
FROM Retailer INNER JOIN Branch ON Retailer.RetailerID = Branch.RetailerID
WHERE (((Retailer.Status)=[the Status]));


Hi Richard,
there it is, thank you-

LR

RE: Access queries

Thanks Lucy

The SQL statement gives me a quick look at what you are trying to create. The basic statement looks fine, and what it looks like is that you are filtering using a variable [the status].

1 .
What I suggest is removing the criteria from the query, and seeing what results you get.

2.
If you get the records showing, then add just a simple critieria (ie. Yes - or whatever one of the values are).

3.
That should then filter the results yuo are looking for. If that works, then you know that the [the status] field is the issue.


If 1-3 return no results, then I suggest you look at the way you built the relationships between the tables. From what it looks like, it is just two tables, with a relationship on [RetailerID].

If this is the case, then check the type of relationship, by clicking on the line between the two tables. There should be 3 options, and depending on which one you choose, the results will differ. Generally Option 1 will give you the standard results, whereas 2 and 3 are more customised, and sometimes do not return any values.


Let me know if that helps.

Regards

Richard


Access tip:

Create a custom Close button on a Form

By default, Forms that you create in Access have a full set of control buttons, that is, a title bar with Minimize, Maximize and Close buttons in the top right-hand corner and a Control Menu in the top left-hand corner.



Sometimes Access needs to follow certain procedures or events as users close a Form (such as automatically opening another Form perhaps). So it is often a good habit to create a custom Close button on a Form for everyone to use, rather than the standard closing cross.



To create a custom Close button:

1) In Form Design View, draw a Command Button onto the Form.

2) Use the Command Button Wizard to select Form Operations under Categories, and Close Form under Actions.

3) Choose Finish.



Access then creates the button and code to close the form for you. You can add any extra code that needs to run as the Form closes to the same Close procedure.



However, the creation of a custom Close button is pointless if the closing X in the top right-hand corner of the Form remains active. To make the closing X inactive, open the Form Properties box then on the Format tab set the Close Button setting to No. This will grey out the closing X leaving it visible, but inactive.



View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.