Microsoft Access query problem

Klo

Klo

Soldato
Joined
20 Nov 2005
Posts
4,112
Location
South East
Hi,

Not sure if this was the right place to ask this, but I'll go ahead anyway :)

This isn't so much a problem with the software as a lack of my skills within the program to make it do what I want.
I am creating a room booking database for a school ( A2 level coursework). I have a table of all the teachers names along with an autonumber primary key. This is related to a teachers field in the booking table as OLE object so I can just use a drop down box to select it.

My problem is that when I run a query searching for all the bookings a certain teacher has made, it doesn't work off the teachers name, but off the autonumber (eg, 6). Obviously, this isn't very useful, but whatever I do I can't get it to run off the teachers name, only on the primary key. I even tried deleting the primary key altogether, but that buggered the entire system up.

Does anyone know of a solution for this?
Thanks :)
 
what are you using to search though the table and display the results, some kind of interface within access?
 
what are you using to search though the table and display the results, some kind of interface within access?

I'm just creating a standard parameter query so I can type in the teachers name I want to find all the bookings for. It works, apart from the fact that I have to type in the autonumber the teacher is, rather than their actual name.
 
i havent used access since university :D but i know it uses sql under the hood for data queries. if you could manually edit those then you can type in the field you need.

is there some type of design mode that allow you to see the sql used to bring up the results?
 
Last edited:
Hehe, you lucky person! It does indeed, but I'm not sure how to find the actual sql, I think you can type it in under search criteria, but not sure. All I can find is stuff about Visual Basic , which is a bit too complicated for a A level piece of work!!
 
Locating SQL View within Access 97 to 2003

1. Within Access, load up the query you wish to see/edit. Have the query window as the active window.

2. In the top left hand corner, where "File | Edit | View |" etc is, just below "File" there should be icon labelled "Design View" (or something similar). Press the little down arrow that with this icon. You will see which types of design views you can choose from. Pick the one called "SQL View".

I would upload a picture, but currently at work, anyway hope this helps :-)

BlackMaster
 
what code are using to get the teacher's name/ID (shouldn't' really matter which as you already have a populated drop down with the teacher's name, but would probs be better to use the id, as then you don't have to use a join in your search sql).
 
Back
Top Bottom