SQL in Access

CoachPhil

Registered User.
Local time
Today, 10:43
Joined
Jun 24, 2008
Messages
83
Silly question,

1-DB named FeedbackSession
1- column named CertifiedListener

If I want to call all of the records from a specific 'Certified Listener', that should be an easy call in SQL, right?

Coach Phil
 
"SELECT DISTINCT [Certified Listener] FROM FeedbackSession"
 
but it is a no go
 
How about

SELECT *
FROM FeedbackSession
WHERE CertifiedListener = "Paul"
 
1-DB named FeedbackSession
1- column named CertifiedListener

If I want to call all of the records from a specific 'Certified Listener', that should be an easy call in SQL, right?

Hi Coach, and welcome to the forums.

A couple of things before an answer can come:
1. The name of your DB is not significant to answering your question.
2. The name of the table you are getting data from is quite significant. I cannot assume that you meant to say your table was named "FeedbackSession", since you go on to say it's not working.
3. You spell "Certified Listener" two different ways. Perhaps that can be causing you problems.
4. What do you mean, "call"? Do you want to display your data in a form, on a report, in a query window, in Excel?

but it is a no go

5. What do you mean, a "no go"? That doesn't describe anything to us that will enable us to help you. What specific error did you receive and where did you receive it/how did it manifest itself?

Did you go into the visual query design tool? Did you select your table from the pop-up? Your field from the table? etc. Did you select group by?

You're right, this should be quite easy. I just want to make sure you're using the right tool to get the result you want. In my opinion, the query design tool is the right tool, for now.
 
Thank you George,

The name of the table is indeed 'FeedbackSession' not the DB.
I will check the spelling on the Certified Listener and yes, I would like to display this information on a Report.

When I say no go, I mean that I can produce no results, it won't select any of the \Certified Listeners for me.
I did select the table from the pop-up, my field from the table, but I did not select group by.

I ended up coding the Command Button with this code;

Private Sub Command16_Click()
On Error GoTo Err_Command16_Click
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT * FROM FeedbackSession WHERE [Certified Listener Name].FeedbackSession Like Me.ListBox.RecordSource;"
Set qdf = dbs.CreateQueryDef("CertifiedListening", strSQL)

'Screen.PreviousControl.SetFocus
'DoCmd.DoMenuItem acFormBar, acEditMenu, 10, , acMenuVer70
'"SELECT * FROM FeedbackSession";
'WHERE Me.List14 = {Certified Listeners Name}.[FeedbackSession]}
'Me.RecordSource = grst.Name
Exit_Command16_Click:
Exit Sub
Err_Command16_Click:
MsgBox Err.Description
Resume Exit_Command16_Click

End Sub

But it continues to create a query everytime I click the button.

CoachPhil
 
Hi Coach,

Not sure why you wrote code to create a query definition. The act of creating a query definition will not show you data. You actually need to run the query (from database window|query). You can also create new queries there.

Best for you to stay away from VBA for now. Looks like it'll give you too much trouble at least until you get your feet wet first.

To create a report that selects data out of FeedbackSession, just use the report wizard and select FeedbackSession as the table. Follow the prompts, aggregating/grouping as needed. When the wizard is done, open the report in design view, right click on the upper left corner of the report window, select properties, select data, and modify your record source (click on the ... on the record source property) from here to get it the way you want it.
 
George,

Thank you, it worked fine that way, just playing with the size of the report now (7 pages).
Sometimes we make things more difficult than they actually are.

thanks again,

Coach
 
George,

Thank you, it worked fine that way, just playing with the size of the report now (7 pages).
Sometimes we make things more difficult than they actually are.

thanks again,

Coach

Hi Coach,

Probably has a lot to do with not knowing what to call things. I've spent most of my life writing software but when I made the plunge into Access I was so lost because of the nomenclature.

I'm glad we could help get you going. Let us know if you need more help.
 

Users who are viewing this thread

Back
Top Bottom