473,461 Members | 1,906 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

To search record

145 100+
I want to create a search form for a library which contain 2 option group;1 is for searching according to keywords,exact match,first on field and phrase,another is type of searching which have different field table such as title,publication,subject,author,call number,ISBN, and any. and also a text field to enter searching.When the search button is click,the result will appear in another form line by line.Do i need to create a query?I dont know ho to create the coding,I get confuse.I am very new to this.
Jul 29 '08
162 9519
puT3
145 100+
There's really very little point in trying a version which is not the same as I've posted.

If there are any changes you need to make then I need to know.

It seems quite clear from this that there are a few changes needed because the information you've provided, even after I have asked and asked for clear reliable information, is still very wrong. I can't imagine what I could have said that would have made it any clearer how important this is.

Let me know if you feel that you cannot provide this information for me, as I will be happy to stop here and now. Frankly I'm feeling more than a little frustrated that you are asking for help, but seem to be unwilling to go to any trouble to provide me with simple information.
Im really sorry... I dont think i change anything but I still need ur help and I will write the complete details of the table,form (includes controls and name) later because i am at my hometown and away from the city i work and i left the notebooks which has all the information about the database there...if u dont mind,can u wait for it?

I really am sorry for all this trouble...
Aug 23 '08 #51
puT3
145 100+
TABLE

Printing Media Library
Expand|Select|Wrap|Line Numbers
  1. CallNumber;Text;PK
  2. AccessionNumber;Text
  3. ISBN/ISSN;Text
  4. Title;Text
  5. SubjectID;Number;FK
  6. PublisherID;Number;FK (PK in Publication table as Publication ID)
  7. Physical Description Area;Text
  8. Bibliography Notes;Text
  9. Description;Text
  10. CopyrightYear;Text
  11. ProviderID;Number;FK
  12. CategoryID;Number;FK
  13. Issue/Edition;Text
  14. AuthorID;Number;FK
  15.  
Subject
Expand|Select|Wrap|Line Numbers
  1. SubjectID;Number;FK
  2. Topical Headings;Text
  3.  
Publication
Expand|Select|Wrap|Line Numbers
  1. Publication ID;Number;PK
  2. Publication Name;Text
  3. Foundation;Text
  4.  
Provider
Expand|Select|Wrap|Line Numbers
  1. ProviderID;Number;PK
  2. Provider Name;Text
  3. Quantity;Text
  4.  
Author
Expand|Select|Wrap|Line Numbers
  1. AuthorID;Number;PK
  2. Author Name;Text
  3. Background;Text
  4.  
Category
Expand|Select|Wrap|Line Numbers
  1. CategoryID;Number;PK
  2. Category Name;Text
  3.  
This is the search form name [Printing Media Library - Search Form]

Search By:
()Keywords - OptKeywords
()Exact Match - OptExact
()First in Field - OptFirst
()Phrase - OptPhrase

Search Type:
() Title - OptTitle
() Author - OptAuthor
() Pulication - OptPublication
() Call Number - OptCall
() Subject - OptSubject
() ISBN/ISSN - OptISBN

Find textbox - TxtFind
Search button - searchrec

this is the result/for filter form named [Printing Media Library]
all are text box control, bound to the [Printing Media Library] table

The query i named as QueryDef....

These is all the table and form of the database...
is there anything i missed??? please let me know and again im really sorry,i hope we can continue this if u are willing to
Aug 23 '08 #52
NeoPa
32,556 Expert Mod 16PB
I am willing.

For now, when I am short of time as the Bytes Online meetup on googlechat is starting soon and I'm not ready yet, I will just say that I do understand how difficult most people find communicating in a clear and precise manner.

In technical areas though, especially when trying to communicate via the medium of a forum web site, this becomes so important that it's very hard to express.

Perhaps I could put it into context if I said that if only half of my time were wasted due to poor communication I'd be ecstatic.

If I get this, but no other, point across in the thread, I will consider you to be well served.

Let's see if we can't also help you with your project.
Aug 23 '08 #53
NeoPa
32,556 Expert Mod 16PB
The next thing you need to do is to take the SQL I posted in post #44 and put it into a QueryDef.

Post here what happens when you try to run that QueryDef.
Aug 23 '08 #54
puT3
145 100+
OK thank you i wil post it when im back at work 2morrow...
Aug 24 '08 #55
puT3
145 100+
Can I ask u why some of the SQL has the field in bracket and some are not..
Aug 25 '08 #56
puT3
145 100+
The next thing you need to do is to take the SQL I posted in post #44 and put it into a QueryDef.

Post here what happens when you try to run that QueryDef.
This is my code where i add the provider table
Expand|Select|Wrap|Line Numbers
  1. SELECT [Printing Media Library].CallNumber,[Printing Media Library].AccessionNumber,[Printing Media Library].ISBN/ISSN,Author.[Author Name],[Printing Media Library].Title,[Printing Media Library].Issue/Edition,Subject.[Topical Headings],Publication.[Publication Name],[Printing Media Library].[Physical Description Area],[Printing Media Library].[Bibliography Notes],[Printing Media Library].CopyrightYear,Provider.ProviderID,[Printing Media Library].CategoryID,[Printing Media Library].Description
  2. FROM (([Printing Media Library] AS tP INNER JOIN [Publication] AS tPu ON tP.PublisherID=tPu.[Publication ID]) INNER JOIN [Author] AS tA ON tP.AuthorID=tA.AuthorID) INNER JOIN [Subject] AS tS ON tP.SubjectID=tS.[Subject ID] INNER JOIN [Provider] AS tPr ON tP.ProviderID=tPr.ProviderID;
  3.  
However there is an error here
Expand|Select|Wrap|Line Numbers
  1. tP.SubjectID=tS.[Subject ID] INNER JOIN [Provider] AS tPr ON tP.ProviderID=tPr.ProviderID;
  2.  
it said that it has 'Syntax error (missing operator) in query expression'

does it need a bracket like this one...
Expand|Select|Wrap|Line Numbers
  1. (([Printing Media Library] AS tP INNER JOIN [Publication] AS tPu ON tP.PublisherID=tPu.[Publication ID]) INNER JOIN [Author] AS tA ON tP.AuthorID=tA.AuthorID)
  2.  
i already check the table to see if i missed anything but i didnt find one...


if all is done, what is the next step...
Aug 25 '08 #57
PianoMan64
374 Expert 256MB
Can I ask u why some of the SQL has the field in bracket and some are not..
The reason why some of the field names have brackets and other don't, is when you have a field name that has spaces in it, you have to rap that in a bracket.

for example: [Company ID]

If you had the name in the table as CompanyID, then you wouldn't have to put the brackets around it.

This is the reason.

Hope that helps,

Joe P.
Aug 25 '08 #58
puT3
145 100+
The reason why some of the field names have brackets and other don't, is when you have a field name that has spaces in it, you have to rap that in a bracket.

for example: [Company ID]

If you had the name in the table as CompanyID, then you wouldn't have to put the brackets around it.

This is the reason.

Hope that helps,

Joe P.
Oh ok thank you for ur help...
Aug 25 '08 #59
puT3
145 100+
The next thing you need to do is to take the SQL I posted in post #44 and put it into a QueryDef.

Post here what happens when you try to run that QueryDef.
I already run the SQL as u posted...When I click run,a message box appear to enter parameter value and i click ok,a datasheet view appear with no data in it...the SQL:

Expand|Select|Wrap|Line Numbers
  1. SELECT [Printing Media Library].CallNumber,[Printing Media Library].AccessionNumber,[Printing Media Library].ISBN/ISSN,Author.[Author Name],[Printing Media Library].Title,[Printing Media Library].Issue/Edition,Subject.[Topical Headings],Publication.[Publication Name],[Printing Media Library].[Physical Description Area],[Printing Media Library].[Bibliography Notes],[Printing Media Library].CopyrightYear,Provider.ProviderID,[Printing Media Library].CategoryID,[Printing Media Library].Description
  2. FROM (((([Printing Media Library] AS tP INNER JOIN [Publication] AS tPu ON tP.PublisherID=tPu.[Publication ID]) INNER JOIN [Author] AS tA ON tP.AuthorID=tA.AuthorID) INNER JOIN [Subject] AS tS ON tP.SubjectID=tS.[Subject ID]) INNER JOIN [Provider] AS tPr ON tP.ProviderID=tPr.ProviderID);
  3.  
so what happen next?
Aug 25 '08 #60
NeoPa
32,556 Expert Mod 16PB
Can I ask u why some of the SQL has the field in bracket and some are not.
You like to keep me busy I see. But that's not a problem, this is an interesting question that others may also need to understand.

In general, using [] to surround object names in SQL is not necessary. However there are situations where, without the [] specifically indicating that the contents refer to an object (Field; Table; Control from a form; Query; Database even sometimes) interpreting the SQL could be ambiguous (Remember we discussed clarity and ambiguity in communication earlier, well it applies even more specifically to computers). Well, if the SQL engine, or interpreter, is unable to understand what is meant, then it will not execute the SQL (at least not correctly).

Examples of possible ambiguity are reserved words (Date; For; SELECT; etc), as well as object names with embedded spaces (SQL uses any white space as a separator). If any of these are used as object names, then the SQL engine would not know whether the word referred to your object or the inbuilt item. Surrounding them in [] makes it clear exactly what is intended.

As far as posting goes, and READABILITY of the SQL, I often use them where they are not strictly required by the SQL engine, to make the context clearer and easier to read. Whenever you see something in the [] you KNOW it's an object. I don't use them so much within my own SQL, but for clarity on the forums I do.

PS. @Joe P.
Sorry, didn't catch your post until after I'd already posted this one. Thanks for jumping in anyway. All contributions appreciated :)
Aug 25 '08 #61
NeoPa
32,556 Expert Mod 16PB
I already run the SQL as u posted...When I click run,a message box appear to enter parameter value and i click ok,a datasheet view appear with no data in it...the SQL:
Expand|Select|Wrap|Line Numbers
  1. ...
  2. Some SQL you've knocked up
  3. ...
  4.  
so what happen next?
If you refer back to post #54 (which you've quoted) you will find that the instructions are crystal clear. There is no ambiguity.

Telling me that a message box appeared prompting for a parameter value (without including even the name showing in the box) is NOT following the instruction.

It's not hard to understand why your response leaves me with nothing to work on. I couldn't help further if I wanted to from this.

I am not going to reverse engineer every piece of SQL you post simply because you cannot seem to pass the information across I need. That takes a lot of time and effort, and I have already done that a couple of times. I don't intend to do that every time you fail to post the information correctly, as clearly, from past experience, I would be spending most of my time doing just that.
Aug 25 '08 #62
puT3
145 100+
If you refer back to post #54 (which you've quoted) you will find that the instructions are crystal clear. There is no ambiguity.

Telling me that a message box appeared prompting for a parameter value (without including even the name showing in the box) is NOT following the instruction.

It's not hard to understand why your response leaves me with nothing to work on. I couldn't help further if I wanted to from this.

I am not going to reverse engineer every piece of SQL you post simply because you cannot seem to pass the information across I need. That takes a lot of time and effort, and I have already done that a couple of times. I don't intend to do that every time you fail to post the information correctly, as clearly, from past experience, I would be spending most of my time doing just that.
Im really sorry again...my earlier response wasnt enough for u to work on,really2 sorry,i dont read the instructions well enough,i really sorry,...

the message box that appear request to enter a parameter value for each of the field,it ask for
Expand|Select|Wrap|Line Numbers
  1. Printing Media Library.CallNumber,
  2. Printing Media Library.Accession Number,
  3. Printing Media Library.ISBN/ISSN,
  4. Author.Author Name,
  5. Printing Media Library.Title,
  6. Printing Media Library.Physical Description Area,
  7. Subject.Topical Headings,
  8. Publication.Publication Name,
  9. Printing Media Library.Bibliography Notes,
  10. Printing Media Library.CopyrightYear,
  11. Provider.ProviderID,
  12. Printing Media Library.CategoryID,
  13. Printing Media Library.Description....
I click ok everytime this message box appear n finally an empty datasheet appear....

i understand if u dont want to continue this but i need help,i will give u every information that u need after this...
Aug 26 '08 #63
NeoPa
32,556 Expert Mod 16PB
There seems to be a fundamental problem here, in that the references in your list don't appear in the SQL I provided in post #44.

SQL will only ask for the value of a reference when it finds it in the SQL and doesn't know how to resolve it.

The SQL I provided makes perfect sense in the context of the information I had from you at that stage, so if there are any failures of reference, they should be few and easily resolvable. In the process we make some headway, at least in the information communicated.

As these reference controls on your form in an incorrect manner, I can only assume that you have tried out some of your own attempted SQL instead of what I provided (in post #44). Looking at this will get us nowhere so let's not even waste our time looking at the various ways this is wrong.

###RESET###
Just go back to post #54 and try again from there.
Aug 26 '08 #64
puT3
145 100+
There seems to be a fundamental problem here, in that the references in your list don't appear in the SQL I provided in post #44.

SQL will only ask for the value of a reference when it finds it in the SQL and doesn't know how to resolve it.

The SQL I provided makes perfect sense in the context of the information I had from you at that stage, so if there are any failures of reference, they should be few and easily resolvable. In the process we make some headway, at least in the information communicated.

As these reference controls on your form in an incorrect manner, I can only assume that you have tried out some of your own attempted SQL instead of what I provided (in post #44). Looking at this will get us nowhere so let's not even waste our time looking at the various ways this is wrong.

###RESET###
Just go back to post #54 and try again from there.
I tried again the SQL u post in post #44 but i do not include the [Provider Name] field from [Provider] table and i change a little bit to match the name of the field i changed which i already given u in earlier post (#52)...

Expand|Select|Wrap|Line Numbers
  1. SELECT tP.CallNumber, tP.AccessionNumber, tP.[ISBN/ISSN], tA.[Author Name], tP.Title, tP.[Issue/Edition], tS.[Topical Headings], tPu.[Publication Name], tP.[Physical Description Area], tP.[Bibliography Notes], tP.CopyrightYear, tP.ProviderID, tP.CategoryID
  2. FROM (([Printing Media Library] AS tP INNER JOIN Publication AS tPu ON tP.PublisherID=tPu.[Publication ID]) INNER JOIN Author AS tA ON tP.AuthorID=tA.AuthorID) INNER JOIN Subject AS tS ON tP.SubjectID=tS.[Subject ID];
  3.  
This time there is no more message box appear,its went straight to a datasheet with all the fields but there is no data in the datasheet,should this happen? Or should it have any data in it?I forgot to ask u what should I expect if I run this SQL code....
Aug 27 '08 #65
puT3
145 100+
Another thing i to ask u,what do u mean by this "you may also want to change some of the control names on [PRINTING MEDIA LIBRARY] to reflect they are no longer referring to the IDs" you have post in post#44....

For the SQL,I should see a list of data right?it still has problem right?

in [Printing Media Library], i make AuthorID,PublisherID,ProviderID and SubjectID as a look up to [Author],[Publication],[Subject],[Provider] table, i shouldnt have any problems right?
Aug 27 '08 #66
NeoPa
32,556 Expert Mod 16PB
I tried again the SQL u post in post #44 but i do not include the [Provider Name] field from [Provider] table and i change a little bit to match the name of the field i changed which i already given u in earlier post (#52)...

Expand|Select|Wrap|Line Numbers
  1. Your SQL
This time there is no more message box appear,its went straight to a datasheet with all the fields but there is no data in the datasheet,should this happen? Or should it have any data in it?I forgot to ask u what should I expect if I run this SQL code....
I am interested in seeing the results of the SQL I posted. I am not interested in seeing the results of any other SQL at this time.

I don't know how much more clear I can make this statement.
Aug 28 '08 #67
NeoPa
32,556 Expert Mod 16PB
Another thing i to ask u,what do u mean by this "you may also want to change some of the control names on [PRINTING MEDIA LIBRARY] to reflect they are no longer referring to the IDs" you have post in post#44....
...
From post #26, the latest published version of this form (updated and displayed below), it has places for the IDs for various elements, but what we really want to show on this form is the descriptions for those elements. This has been handled in the SQL (it returns the descriptions rather than the IDs now), but the names of the controls on your form have not (as far as I'm aware - & I should be) been changed to reflect these changes.
Form Name=[PRINTING MEDIA LIBRARY]
Expand|Select|Wrap|Line Numbers
  1. Control; Type
  2. Call Number; TextBox
  3. Accession Number; TextBox
  4. ISBN; TextBox
  5. AuthorID; TextBox
  6. Title Statement; TextBox
  7. Issue; TextBox
  8. SubjectID; TextBox
  9. PublisherID; TextBox
  10. Physical Description Area; TextBox
  11. Bibliography Notes; TextBox
  12. Description; TextBox
  13. Copyright Year; TextBox
  14. ProviderID; TextBox
  15. CategoryID; TextBox
...
For the SQL,I should see a list of data right?it still has problem right?
...
I have no way of knowing yet, as you haven't given me any info regarding what happens when you run THE EXACT SQL I posted.
...
in [Printing Media Library], i make AuthorID,PublisherID,ProviderID and SubjectID as a look up to [Author],[Publication],[Subject],[Provider] table, i shouldnt have any problems right?
If you follow the instructions correctly there should be no need for doing any extra lookups. You would certainly NOT want to design any into your form.
Aug 28 '08 #68
puT3
145 100+
From post #26, the latest published version of this form (updated and displayed below), it has places for the IDs for various elements, but what we really want to show on this form is the descriptions for those elements. This has been handled in the SQL (it returns the descriptions rather than the IDs now), but the names of the controls on your form have not (as far as I'm aware - & I should be) been changed to reflect these changes.
Form Name=[PRINTING MEDIA LIBRARY]
Expand|Select|Wrap|Line Numbers
  1. Control; Type
  2. Call Number; TextBox
  3. Accession Number; TextBox
  4. ISBN; TextBox
  5. AuthorID; TextBox
  6. Title Statement; TextBox
  7. Issue; TextBox
  8. SubjectID; TextBox
  9. PublisherID; TextBox
  10. Physical Description Area; TextBox
  11. Bibliography Notes; TextBox
  12. Description; TextBox
  13. Copyright Year; TextBox
  14. ProviderID; TextBox
  15. CategoryID; TextBox
I have no way of knowing yet, as you haven't given me any info regarding what happens when you run THE EXACT SQL I posted.

If you follow the instructions correctly there should be no need for doing any extra lookups. You would certainly NOT want to design any into your form.
Sorry I was away yesterday that i couldn't reply back to you...

If I exactly run your posted SQL,a message box will appear and requesting for parameter for each of the field and click ok for each box appear without entering anything it in and lastly it will show a empty datasheet....because i think it does not match the field name in the table...is it true? thats why i changed a little of the name to match the name of the field in the table....

this is your code that i run....i copy it exactly like it in the query
Expand|Select|Wrap|Line Numbers
  1. SELECT tP.[Call Number],
  2.        tP.[Accession Number],
  3.        tP.ISBN,
  4.        tA.[Author Name],
  5.        tP.[Title Statement],
  6.        tP.Issue,
  7.        tS.SubjectTitle,
  8.        tPu.[Publication Name],
  9.        tP.[Physical Description Area],
  10.        tP.[Bibliography Notes],
  11.        tP.[Copyright Year],
  12.        tP.[Provider ID],
  13.        tP.CategoryID
  14.  
  15. FROM (([Printing Media Library] AS tP INNER JOIN
  16.        [Publication] AS tPu
  17.   ON   tP.PublisherID=tPu.[Publication ID]) INNER JOIN
  18.        [Author] AS tA
  19.   ON   tP.AuthorID=tA.AuthorID) INNER JOIN
  20.        [Subject] AS tS
  21.   ON   tP.SubjectID=tS.SubjectID
  22.  
Aug 29 '08 #69
puT3
145 100+
Im sorry I just reread all your post n I missed to change the recordsource of the form to the query.However,the problems occur when i run it as I previously posted..there are no data in it...
Aug 29 '08 #70
puT3
145 100+
sorry the same problem occur
Aug 29 '08 #71
NeoPa
32,556 Expert Mod 16PB
This is more like what I need.

Creating the QueryDef from it is only important later. It should just make life easier for you when we get it right and want to move on from here.

There is still a bit more information I need from you though. I have designed the SQL based on the information you've provided for me. This means that, if it's not working perfectly there are two possible reasons :
  1. I have made an error in creating the SQL (possible, we can check this).
  2. The information you have passed is incorrect.
It seems that the SQL is not recognising the names of the objects listed. These have come directly from what you've told me and I have asked you to check these on a number of occasions.

What I need from you now is a list of the messages for all the prompts you get when you try to run this. Doing them one-by-one is possible, but will take much longer. From what you say it SEEMS that the errors are fundamentally simple ones of getting the names of the fields wrong. I see nothing so far that indicates the linking of the tables together might be a problem.
Aug 29 '08 #72
puT3
145 100+
Ok,i'll do it...but i get it to you later because im at my hometown because of public holiday(independence day)....i'll give to you as soon as possible...
Aug 30 '08 #73
NeoPa
32,556 Expert Mod 16PB
No worries.

I have plenty to keep me busy ;)
Aug 30 '08 #74
puT3
145 100+
Sorry about the long break...the message box appear like this....
Enter Parameter Value....tP.Call Number
Enter Parameter Value....tP.Accession Number
Enter Parameter Value....tP.ISBN
Enter Parameter Value....tP.Title Statement
Enter Parameter Value....tP.Issue
Enter Parameter Value....tS.Subject Title
Enter Parameter Value....tP.Copyright Year
Enter Parameter Value....tP.Provider ID
Enter Parameter Value....tS.Subject ID

I think I want to give you the table of [Printing Media Library] again,see if i missed anything since i changed the name a little while the form i make directly from the change table...

Table Name=[Printing Media Library]
Expand|Select|Wrap|Line Numbers
  1. Field                      Type   IndexInfo
  2. CallNumber                 String     PK
  3. AccessionNumber            String
  4. ISBN/ISSN                  String
  5. Title                      String
  6. SubjectID                  Number     FK
  7. PublisherID                Number     FK
  8. Physical Description Area  String
  9. Bibliography Notes         String
  10. Description                String
  11. CopyrightYear              String
  12. ProviderID                 Number     FK
  13. CategoryID                 Number     FK
  14. Issue/Edition              String
  15. AuthorID                   Number     FK
Table Name=[Author]
Expand|Select|Wrap|Line Numbers
  1. Field             Type   IndexInfo
  2. AuthorID          Number     PK
  3. Author Name       String
  4. Background        String
Table Name=[Subject]
Expand|Select|Wrap|Line Numbers
  1. Field             Type   IndexInfo
  2. Subject ID
  3. Topical Headings  String
Table Name=[Provider]
Expand|Select|Wrap|Line Numbers
  1. Field         Type  IndexInfo
  2. ProviderID    Number    PK
  3. ProviderName  String
  4. Quantity      String
Table Name=[Publication]
Expand|Select|Wrap|Line Numbers
  1. Field             Type   IndexInfo
  2. Publication ID    Number     PK
  3. Publication Name  String
  4. Foundation        String
Table Name=[Category]
Expand|Select|Wrap|Line Numbers
  1. Field          Type   IndexInfo
  2. CategoryID     Number     PK
  3. Category Name  String
Sep 2 '08 #75
puT3
145 100+
i already try everything that i could think of like redo it,change the name so it is exactly as innthe table but the i have the same result..and i have approx 32 days left
Sep 2 '08 #76
NeoPa
32,556 Expert Mod 16PB
Right.

This is so different from the data I was working from that there's no wonder the SQL doesn't work.

I have taken the precaution of shaving my head, to avoid the risk of pulling all my hair out. I can't bring myself to remove my beard at this time so I'll just have to watch myself.

I won't go through the importance of clear communication again, in any detail. It's enough to say that this situation has come about entirely through really bad communication from the start.

I will spend some time editing your post so that the metadata information (which describes the layouts of the tables) is laid out clearly and consistently, then I will see what I can do about posting some amended SQL for you to try.

From what you say, I understand that you have changed the name of what was the [Printing] table to be [PRINTING MEDIA LIBRARY] now. As there is already a form of that name, I can't imagine why you felt that was a good idea. This will make communication doubly difficult for you. I will be fine as I'm always careful about how I express things. You aren't, and I can only expect further problems from this. I will however continue on these lines as this is what you've indicated you have.

Lastly (for now), please check the information when I change it (you will see the difference) and make sure there are no errors. If there are any errors in this then this will cost you, and the project, time.
Sep 2 '08 #77
NeoPa
32,556 Expert Mod 16PB
Having gone through looking at what you've posted I find I must compare it with what you posted previously to see if I can fix some of the more obvious errors. Some bits are missing. Some fields are flagged as FK where before they were PK. Etc.

This will take more time I'm afraid, and will further delay progress.

In future, if time is an issue for you, it would be a good idea to check what you post thoroughly for errors before you post it.

PS. Clearly this involves an element of deduction on my part so you will need to check that I haven't assumed anything incorrectly here.
Sep 2 '08 #78
NeoPa
32,556 Expert Mod 16PB
For your Subject table, before, you had :
Table Name=[Subject]
Expand|Select|Wrap|Line Numbers
  1. Field             Type IndexInfo
  2. SubjectID         Number   PK (where in main table ([Printing]) is PublisherID)
  3. SubjectTitle      String
  4. Topical Headings  String
Now you have :
Table Name=[Subject]
Expand|Select|Wrap|Line Numbers
  1. Field             Type   IndexInfo
  2. Subject ID
  3. Topical Headings  String
Either that's a mistake or you are randomly damaging your own project.
I cannot see why any sane person would add a space into the middle of a field name :S

Your posted error messages (EG. Enter Parameter Value....tS.Subject ID) are also inaccurate. Some have spaces added in where no spaces exist. I appreciate that you can't copy / paste this information in, but if you type the message out incorrectly (particularly the prompted name) then I will waste much time searching for something that doesn't exist. For someone who says they're in a hurry you certainly seem to waste a great deal of time.

I've been working for over an hour now SIMPLY fixing all your errors. Not doing anything that takes us forward at all. Simply fixing incorrect information that you have posted. I have to say that if I find much more of this I will walk away. Your attitude to my time is frankly disrespectful.

What is so frustrating particularly is that this question shouldn't even be particularly difficult. It's straightforward with the right info, producing powerful results.
Sep 2 '08 #79
NeoPa
32,556 Expert Mod 16PB
Try the following SQL (as before) and tell me what, if any, errors it gives. The names in the error message must be reproduced exactly. No adding or losing of spaces please.
Expand|Select|Wrap|Line Numbers
  1. SELECT tPML.CallNumber,
  2.        tPML.AccessionNumber,
  3.        tPML.ISBN/ISSN,
  4.        tA.[Author Name],
  5.        tPML.Title,
  6.        tPML.Issue/Edition,
  7.        tS.SubjectTitle,
  8.        tPu.[Publication Name],
  9.        tPML.[Physical Description Area],
  10.        tPML.[Bibliography Notes],
  11.        tPML.CopyrightYear,
  12.        tPr.ProviderName,
  13.        tC.[Category Name]
  14.  
  15. FROM (((([Printing Media Library] AS tPML INNER JOIN
  16.          [Publication] AS tPu
  17.   ON     tPML.PublisherID=tPu.[Publication ID]) INNER JOIN
  18.          [Author] AS tA
  19.   ON     tPML.AuthorID=tA.AuthorID) INNER JOIN
  20.          [Subject] AS tS
  21.   ON     tPML.SubjectID=tS.SubjectID) INNER JOIN
  22.          [Provider] AS tPr
  23.   ON     tPML.ProviderID=tPr.ProviderID) INNER JOIN
  24.          [Category] AS tC
  25.   ON     tPML.CategoryID=tC.CategoryID
I have updated the names in the SQL as much as possible to match your latest posted tables. If the information provided is at least close enough to correct to enable a good guess as to what you have then this should work.

Again, the SQL is untested as yet so there is always room for errors on my part. I will only know for sure when you post back any updates as to current information. Either results of the query or known changes to the currently posted information.
Sep 2 '08 #80
puT3
145 100+
All is my fault for not unclear information and communication...im trying your new posted SQL...but i posted the error as exactly the queries produce when i run for the first SQL u give me,i did it one by one,and write it here...

Ok I already run your new SQL in query,the result, there is no messages/prompt box appear when run it,it goes straight to datasheet however it just blank datasheet with the field name only...I believe and confident that I already give the correct information about all the table,their filed name,type and everything,there is no more changes made...if there anything else missing please let me know...
Sep 3 '08 #81
puT3
145 100+
the row of the query has that (i dont know what it call,it appear when we want to add new words/things,when open word its there on the white paper)...when i try to enter any words,its said cannot add record(s);join key of table "Printing Media Library' not in recordset...
i attach the picture that shows the query and what i meant earlier,it is a part of it
Attached Images
File Type: jpg query.JPG (6.7 KB, 124 views)
Sep 3 '08 #82
puT3
145 100+
I try ur SQL one by one. If I start the FROM clause from here clause
Expand|Select|Wrap|Line Numbers
  1.  
  2. FROM (((([Printing Media Library] AS tPML INNER JOIN
  3.          [Publication] AS tPu
  4.   ON     tPML.PublisherID=tPu.[Publication ID]) 
  5.  
until

Expand|Select|Wrap|Line Numbers
  1. INNER JOIN
  2.          [Author] AS tA
  3.   ON     tPML.AuthorID=tA.AuthorID)INNER JOIN
  4.          [Category] AS tC
  5.   ON     tPML.CategoryID=tC.CategoryID
  6.  
it will shows all the data related and it works fine

but if I add this SQL
Expand|Select|Wrap|Line Numbers
  1.  INNER JOIN
  2.          [Subject] AS tS
  3.   ON     tPML.SubjectID=tS.SubjectID) INNER JOIN
  4.          [Provider] AS tPr
  5.   ON     tPML.ProviderID=tPr.ProviderID)
  6.  
the datasheet will be completely blank,no data..do you think something wrong with the tables or the code?Sorry if this make you confuse or anything...
Is it okay if the table do not have any data at the moment because my [Provider] table do no have any but [Subject] do have data
Sep 3 '08 #83
NeoPa
32,556 Expert Mod 16PB
I will reply to all your most recent three posts. Together, they make the situation quite clear (well done).

With INNER JOINs (as I have used) it is indeed important that all tables have matching data. If ANY of the tables is without a matching record then nothing is displayed.

The following SQL is changed such that all INNER JOINs are replaced by LEFT JOINs. This will give you more data, but it may also mean that you get some records with Null values for some of the linked fields. This may not be a problem for you, but it is important that you are aware of this and what it means.
Expand|Select|Wrap|Line Numbers
  1. SELECT tPML.CallNumber,
  2.        tPML.AccessionNumber,
  3.        tPML.ISBN/ISSN,
  4.        tA.[Author Name],
  5.        tPML.Title,
  6.        tPML.Issue/Edition,
  7.        tS.SubjectTitle,
  8.        tPu.[Publication Name],
  9.        tPML.[Physical Description Area],
  10.        tPML.[Bibliography Notes],
  11.        tPML.CopyrightYear,
  12.        tPr.ProviderName,
  13.        tC.[Category Name]
  14.  
  15. FROM (((([Printing Media Library] AS tPML LEFT JOIN
  16.          [Publication] AS tPu
  17.   ON     tPML.PublisherID=tPu.[Publication ID]) LEFT JOIN
  18.          [Author] AS tA
  19.   ON     tPML.AuthorID=tA.AuthorID) LEFT JOIN
  20.          [Subject] AS tS
  21.   ON     tPML.SubjectID=tS.SubjectID) LEFT JOIN
  22.          [Provider] AS tPr
  23.   ON     tPML.ProviderID=tPr.ProviderID) LEFT JOIN
  24.          [Category] AS tC
  25.   ON     tPML.CategoryID=tC.CategoryID
See how this works for you.
Sep 3 '08 #84
NeoPa
32,556 Expert Mod 16PB
Would you mind also revisiting post #79 and confirming that the metadata for the [Subject] table is actually unchanged from the original (as displayed in that post).
Sep 3 '08 #85
puT3
145 100+
Would you mind also revisiting post #79 and confirming that the metadata for the [Subject] table is actually unchanged from the original (as displayed in that post).
I changed a little bit of the field in [Subject] table.
This is the original.
Table Name=[Subject]
Expand|Select|Wrap|Line Numbers
  1. Field             Type IndexInfo
  2. SubjectID         Number   PK
  3. SubjectTitle      String
  4. Topical Headings  String
to this
this is the new table
Table Name=[Subject]
Expand|Select|Wrap|Line Numbers
  1. Field             Type IndexInfo
  2. SubjectID         Number   PK
  3. Topical Headings  String
I just delete the SubjectTitle field. That's all that I changed
Sep 4 '08 #86
puT3
145 100+
OK, the new SQL you posted work,it show all the data and i changed the recordsource of the form [Printing Media Library]...Sorry take so long just to make the SQL work...What is the next step...
Sep 4 '08 #87
NeoPa
32,556 Expert Mod 16PB
Well, as there is a reference in the SQL to tS.SubjectTitle, I can't see how this is not throwing up a prompt at least (unless you've changed the SQL to handle it).

That line (#7) should now read :
Expand|Select|Wrap|Line Numbers
  1. tS.[Topical Headings]
Please let me know if this makes sense (did you change the SQL to handle this already)?

Have you made any other changes that I should be aware of (please explain any changes rather than posting the SQL you used)?

PS. In the mean time I will look at steps we can take from here. Getting the SQL working is a fundamental step (Yay :))
Sep 4 '08 #88
NeoPa
32,556 Expert Mod 16PB
Right, now we look at the design of the [Search Form] form. This form will have pretty well all the logic and control built into it. In fact, this will mostly be in the [SearchRec] Command Button (I suggest you rename this to [cmdSearch] - this will make it clearer what we are working with).

[Search Form] should now have a record source of [qryPrinting] with SQL as post #84 but probably amended by post #88.

Form Name=[Search Form]
Expand|Select|Wrap|Line Numbers
  1. Control        Type           Values
  2. [Search By]    OptionGroup    1 = optKeywords
  3.                               2 = optExact
  4.                               3 = optFirst
  5.                               4 = optPhrase
  6. [Search Type]  OptionGroup    1 = optTitle
  7.                               2 = optAuthor
  8.                               3 = optPublication
  9.                               4 = optCall
  10.                               5 = optSubject
  11.                               6 = optISBN
  12. txtFind        TextBox
  13. cmdSearch      CommandButton
If everything I now understand is correct then the following code should go a long way to providing your solution.

Check first to see if it works.

If not then let's have the full and clear information as to what happens.

If it does, then look at the code and make sure you understand what it is doing, and why. I can explain any parts you're not sure of, and understanding the process is important for you if you are to support it going forward.
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdSearch_Click()
  2.   Dim strWhere As String, strField As String
  3.  
  4.   '%F ==> Field to search on
  5.   '%E ==> Equality operator
  6.   '%V ==> Value (to search for)
  7.   strWhere = "[%F] Like '%V'"
  8.   Select Case Me.[Search Type]
  9.   Case 1
  10.     strField = "Title"
  11.   Case 2
  12.     strField = "Author Name"
  13.   Case 3
  14.     strField = "Publication Name"
  15.   Case 4
  16.     strField = "CallNumber"
  17.   Case 5
  18.     strField = "Topical Headings"
  19.   Case 6
  20.     strField = "ISBN/ISSN"
  21.   End Select
  22.   strWhere = Replace(strWhere, "%F", strField)
  23.   Select Case Me.[Search By]
  24.   Case 1
  25.     strWhere = Replace(strWhere, "%V", "*" & Me.txtFind & "*")
  26.   Case 2
  27.     strWhere = Replace(strWhere, "%V", Me.txtFind)
  28.     strWhere = Replace(strWhere, "Like", "=")
  29.   Case 3
  30.     strWhere = Replace(strWhere, "%V", Me.txtFind & "*")
  31.   Case 4
  32.     'Nothing here as I'm not sure what this means
  33.   End select
  34.   Call DoCmd.OpenForm(FormName:="[Printing Media Library]", _
  35.                       WhereCondition:=strWhere, _
  36.                       DataMode:=acFormReadOnly)
  37. End Sub
Sep 4 '08 #89
puT3
145 100+
In
Expand|Select|Wrap|Line Numbers
  1. Select Case Me.[Search By]
  2.    Case 4 
  3.  
It is for OptPhrase,I think I will skip this one,im not going to use it...you can ignore this...
Sep 5 '08 #90
NeoPa
32,556 Expert Mod 16PB
Quote added retrospectively from memory as the original contents of post #90 have been completely replaced.
Yes, I fixed the SQL from tS.SubjectID to tS.[Topical Headings]...
We may be nearly there now, but making changes without telling me is the sort of thing which may still throw a spanner in the works.

I can't make intelligent decisions without correct information.

Did you see the other question? Were any other changes made?
If so, my earlier post may not work very well for you (although it should give you an example to work from at least).
Sep 5 '08 #91
puT3
145 100+
I am trying urs code right now...Ill get it back to u
Sep 5 '08 #92
puT3
145 100+
Expand|Select|Wrap|Line Numbers
  1.   '%F ==> Field to search on
  2.   '%E ==> Equality operator
  3.   '%V ==> Value (to search for)
  4.  
What is these mean?
Do I need to write these one?
Expand|Select|Wrap|Line Numbers
  1.  ==> Field to search on
  2.  ==> Equality operator
  3.  ==> Value (to search for)
  4.  
sorry I understan it now
Sep 5 '08 #93
puT3
145 100+
Expand|Select|Wrap|Line Numbers
  1.   Case 1
  2.     strField = "Title"
  3.   Case 2
  4.     strField = "Author Name"
  5.   Case 3
  6.     strField = "Publication Name"
  7.   Case 4
  8.     strField = "CallNumber"
  9.   Case 5
  10.     strField = "Topical Headings"
  11.   Case 6
  12.     strField = "ISBN/ISSN"
  13.  
I dont understand this,is it the (Title,Author Name, Publication Name,CallNumber,Topical Headings and ISBN/ISSN) are from the query/table?

Why are OptTitle,OptPublication..... are not used?
Expand|Select|Wrap|Line Numbers
  1. strwhere =  Replace (strWhere,'%F",strField)
  2.  
and what is the Replace function?

Another thing,I forgot 2 ask u, in this code
Expand|Select|Wrap|Line Numbers
  1. Select Case Me.[Search By]
  2.  
Is it the name of the option group frame?

tq again
Sep 5 '08 #94
puT3
145 100+
I try this code from ur post
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm(FormName:="[Printing Media Library]", WhereCondition:=strWhere, DataMode:=acFormReadOnly)
  2.  
but I get an error said "Expected:="

No other changes are made except for OptPhrase where I exclude it and delete it from the form...does it affect anything if I delete it?

Is this form for read only because i see the data mode is read only?
It shows result line by line right?

Do u remember from before I said that I want to have a checkbox in the form so that user can view the complete details of the search material in another form?

because I want the filtered form only shows partial of information for example,
if user click on author, in the filtered form i want it to show the author name,title,year,and ISBN number and have a checkbox next to it,so that the user will click it and another form that have full details will appear....

sorry if this will change the coding,i just want to tell u in case u forget about it....
Sep 5 '08 #95
puT3
145 100+
(1) I already ur code, at first it seem to be running eventhough a message box appear
(2) However,the next time I try it,nothing happen when I click the Search button...what is the problem?Is it the code? I do not change anything except I change the name of the button (cmdSearch) and the text box(txtFind) to match the name in the code

I try to make a new form but it still doesnt work...Any detail that u want cuz im not sure what detail it is cuz there is no error message for (2)
Sep 5 '08 #96
puT3
145 100+
I fixed the error but the code do not open the [Printing Media Library] form instead a Find and Replace box appear
Sep 5 '08 #97
NeoPa
32,556 Expert Mod 16PB
In
Expand|Select|Wrap|Line Numbers
  1. Select Case Me.[Search By]
  2.    Case 4 
  3.  
It is for OptPhrase,I think I will skip this one,im not going to use it...you can ignore this...
Thank you for this info.

To effect this simply remove lines #31 & #32 from the code in post #89.
Sep 5 '08 #98
NeoPa
32,556 Expert Mod 16PB
Expand|Select|Wrap|Line Numbers
  1. Case 1
  2.   strField = "Title"
  3. Case 2
  4.   strField = "Author Name"
  5. Case 3
  6.   strField = "Publication Name"
  7. Case 4
  8.   strField = "CallNumber"
  9. Case 5
  10.   strField = "Topical Headings"
  11. Case 6
  12.   strField = "ISBN/ISSN"
I dont understand this,is it the (Title,Author Name, Publication Name,CallNumber,Topical Headings and ISBN/ISSN) are from the query/table?

Why are OptTitle,OptPublication..... are not used?
...
This is because when an option control is selected within an Option Group, the value of the Option Group itself reflects which of its option controls is currently selected. As there is only one that can be selected at any time, this is quite logical and makes for easier checking. It is also possible to check the vlaues of the option controls themselves.
...
Expand|Select|Wrap|Line Numbers
  1. strWhere = Replace(strWhere,'%F",strField)
and what is the Replace function?
...
I suggest you find the Help on this for a full explanation. Essentially though, it replaces all occurrences of the second parameter, where found in the first parameter, with the third parameter.
Expand|Select|Wrap|Line Numbers
  1. Debug.Print Replace("ABCDEFG", "C", "_")
  2. AB_DEFG
...
Another thing,I forgot 2 ask u, in this code
Expand|Select|Wrap|Line Numbers
  1. Select Case Me.[Search By]
Is it the name of the option group frame?

tq again
Yes :)

See earlier explanation of your Select Case question.
Sep 5 '08 #99
NeoPa
32,556 Expert Mod 16PB
I try this code from ur post
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenForm(FormName:="[Printing Media Library]", WhereCondition:=strWhere, DataMode:=acFormReadOnly)
but I get an error said "Expected:="

No other changes are made except for OptPhrase where I exclude it and delete it from the form...does it affect anything if I delete it?
...
The code you have posted cannot run as you have posted it. You say you have made no changes to the code, yet I can immediately see that the first word of my original code on the line (Call) is missing and that you have merged the line into one from three.

Now, call me picky if you will, but I have 101 examples, in this thread, of where you've changed things you don't fully understand, without telling me what you've changed, and I've had to work out what's gone wrong.

So, for this, I want to see where my original code went wrong.

Removing OptPhrase should not cause any problems for the code as posted.
...
Is this form for read only because I see the data mode is read only?
It shows result line by line right?
...
I expect it will be read only. The query it's bound to will probably make it read only. I'm not sure what you mean when you say "I see the data mode is read only?" though. Where?

If it shows results line by line, then this is how you've designed your form. We have not discussed how this should be done as it doesn't effect what we're doing very directly. Certainly showing the results in DataSheet mode should not cause any problems.
...
Do u remember from before I said that I want to have a checkbox in the form so that user can view the complete details of the search material in another form?

because I want the filtered form only shows partial of information for example,
if user click on author, in the filtered form i want it to show the author name,title,year,and ISBN number and have a checkbox next to it,so that the user will click it and another form that have full details will appear....

sorry if this will change the coding,i just want to tell u in case u forget about it....
I don't remember that, but it's not important. You've mentioned it again now.

This is not something we should be looking at immediately. I assume you want the further detail to be shown from something found on the [Printing Media Library] form.

We're principally looking at the code on the [Search Form] for now. I don't think adding this functionality later to the [Printing Media Library] form will be a problem. It shouldn't effect what we're doing now.
Sep 5 '08 #100

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: CharitiesOnline | last post by:
Hello, I have set this script up to add paging to a search results page. Which on the first page works fine. I calculates how many pages there should be depending on the number of results returned...
1
by: Jack-of-all-traits | last post by:
This is a big problem and I really need help, no one seems to know how to solve this problem. I want to take the data from a record in a particular a field that contains the names of generic...
9
by: Christopher Koh | last post by:
I will make a form which will search the database (just like google interface) that will look/match for the exact name in the records of a given fieldname. Any suggestions on how to make the code?
8
by: Steph | last post by:
Hi. I'm very new to MS Access and have been presented with an Access database of contacts by my employer. I am trying to redesign the main form of the database so that a button entitled...
7
by: John | last post by:
hi, i have created a search form, and i want to search for a specific item in a field. e.g. i have a field called colour, which has record1 = 'red, blue, green' and another record2 = 'red' ...
3
by: vonclausowitz | last post by:
Hi All, I was thinking of creating a table in my database to index all words in the database. That way I can quickly search for one or more words and the index table will return the words and...
1
by: Eric | last post by:
Hi: I have two files. I search pattern ":" from emails text file and save email contents into a database. Another search pattern " field is blank. Please try again.", vbExclamation + vbOKOnly...
3
by: bluez | last post by:
I want to design a webpage where user can search the data from the database and list out the related records. Each of the record got a delete button which allow user to delete the record. ...
1
by: captainmorgan | last post by:
I have included an unbound field called which is used to quickly move to the desired record, by searching the last name field. I have been using this code for a few years, with only one...
9
by: AMBLY | last post by:
Hello ! Hope someone might be able to help me with this one. I run Access2000 on XP. I have a form : frmONE- which contains a txt field: ctrCTN from my table/database. The values in ctrCTN are...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.