473,462 Members | 1,055 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 9521
NeoPa
32,556 Expert Mod 16PB
Another question I want to asked,is it possible to keep the old data after being update?
For example, someone lend a book at a certain e.q.23/09/08 and return it 25/09/08 then someone else lend the same book on 27/09/08...I want to keep the previous date as a history,maybe in table or report..how can i do this?
This depends entirely on the design of your database, and is too complicated for me to issue simple instructions.

You need to consider exactly what you want. Will you keep all the data in one table (in which case it is important that the PK does not preclude multiple entries). This would also mean that any references to the table need to handle multiple entries, and select only the current one if that is what is required.

An alternative would be to have a separate history table (generally less recommended, but possibly easier to apply AFTER you already have a working database), where records could be copied when they are no longer current. Care needs to be taken with either approach and, while I can say the first is probably the better way when done properly, I will not be able to take you through this as it depends very much on precise information.
Sep 23 '08 #151
puT3
145 100+
This depends entirely on the design of your database, and is too complicated for me to issue simple instructions.

You need to consider exactly what you want. Will you keep all the data in one table (in which case it is important that the PK does not preclude multiple entries). This would also mean that any references to the table need to handle multiple entries, and select only the current one if that is what is required.

An alternative would be to have a separate history table (generally less recommended, but possibly easier to apply AFTER you already have a working database), where records could be copied when they are no longer current. Care needs to be taken with either approach and, while I can say the first is probably the better way when done properly, I will not be able to take you through this as it depends very much on precise information.
Oh i see....there is nothing you can do for me,is it?...I already set up a new table [History] which I thought will be simple at first but I think I would like to keep in one table which is [Printing Media Library] if possible...I make a form [Update Date] which has a button [cmdSaveUpdate], its function to save and update the data in [Printing Media Library] table,recordsource is [QueryDef]...If you can help...
Sep 24 '08 #152
puT3
145 100+
Sorry I have to ask this question here, I try to make a security of my database using Tools-Security...how to make it run without the login form appear
................Its ok i found the solution
Sep 24 '08 #153
NeoPa
32,556 Expert Mod 16PB
Oh i see....there is nothing you can do for me,is it?...I already set up a new table [History] which I thought will be simple at first but I think I would like to keep in one table which is [Printing Media Library] if possible...I make a form [Update Date] which has a button [cmdSaveUpdate], its function to save and update the data in [Printing Media Library] table,recordsource is [QueryDef]...If you can help...
I can only really help with some general points here. To be honest, this whole area can get quite fiddly, and this sort of thing can only be done with good reliable levels of communication. A forum doesn't make this easy, and your past history doesn't lead me to believe you are up to the task.

So, some general pointers that may help, before I sign off. When storing expired data in the same table as live data, there are some issues you should be aware of.
  1. There will need to be (at least) one extra field in the record to handle indicating which records are current and which are expired.
  2. You may have many sections of your project which already access this table, but which most probably need changing to manage the expired records existing where previously there were just live ones.
  3. You will probably have some sort of Unique index of fields which define your items. This index (these indeces) will need to be changed to incorporate any new fields which indicate the status of the record.
Point #2 may indeed be wide-ranging. Be very careful of this.

As an illustration, say we have a simple table ([tblProduct]) which contains all live product info.
Table Name=[tblProduct]
Expand|Select|Wrap|Line Numbers
  1. Field           Type        IndexInfo
  2. ProductID       AutoNumber  PK
  3. ProductCode     String      Index
  4. ProdDesc        String      FK
  5. Price           Number
When we add the field [ExpiryDate], notice how it must be added into the Index (it now becomes a Compound Index). If this is not done then adding a current product (No value in [ExpiryDate]), after expiring the previous one, would fail.
Table Name=[tblProduct]
Expand|Select|Wrap|Line Numbers
  1. Field           Type        IndexInfo
  2. ProductID       AutoNumber  PK
  3. ProductCode     String      CompoundIndex
  4. ExpiryDate      Date        CompoundIndex
  5. ProdDesc        String      FK
  6. Price           Number
I hope this helps. I suspect it's as far as I can go on this problem.
Sep 24 '08 #154
NeoPa
32,556 Expert Mod 16PB
Your latest question is not related to this thread, so I will move it across into it's own thread (Login Form) for you.

It has a link back to this one for anyone interested in reading back.
Sep 25 '08 #155
puT3
145 100+
Hi again...In the previous post I have asked about how to transfer every data from [Printing Media Library] form to report so that it can be printed. I used this coding as you give it to me.However,the problem is the record do not come out in the report...
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdPrintingReport_Click()
  2.  
  3.     Dim strReportName As String
  4.     Dim strCriteria As String
  5.  
  6.     strReportName = "Printing Search Result"
  7.     strCriteria = "(([ISBN/ISSN] = '" & Me![ISBN/ISSN] & "')"
  8.     strCriteria = strCriteria & " AND ([Topical Headings] = '" & Me![Topical Headings] & "')"
  9.     strCriteria = strCriteria & " AND ([Publication Name] = '" & Me![Publication Name] & "')"
  10.     strCriteria = strCriteria & " AND ([Title] = '" & Me![Title] & "')"
  11.     strCriteria = strCriteria & " AND ([Author Name] = '" & Me![Author Name] & "')"
  12.     strCriteria = strCriteria & " AND ([CallNumber] = '" & Me![CallNumber] & "'))"
  13.  
  14.     DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
  15.     DoCmd.Close acForm, "Printing Media Library"
  16.  
  17.  
  18. End Sub
  19.  
I try it on another form it works ok except that in the report it only display on records only when it have many records
Oct 7 '08 #156
NeoPa
32,556 Expert Mod 16PB
This doesn't look like code I would post. Can you point me to where I posted it?
Oct 7 '08 #157
NeoPa
32,556 Expert Mod 16PB
I try it on another form it works ok except that in the report it only display on records only when it have many records
If you could explain this too please. It doesn't make sense to me :S
Oct 7 '08 #158
puT3
145 100+
This doesn't look like code I would post. Can you point me to where I posted it?
Post #144 but its ok, i tried it again and it work,maybe somewhere in the code i type in was wrong...The only problem is when the record it appear on report,it only shows 1 record only in one page when they should be more of one records...For example, when user search for title of book named "design" (in the table have many books titled design), it appear correctly in result form but when I want to print it and i click a button (the button contains the aboce coding),it only shows of one record, the user need to go back to and go over the same process
Oct 8 '08 #159
NeoPa
32,556 Expert Mod 16PB
That actually makes perfect sense.

The solution was to open the report with the currently selected record. Not with the same selection of records that are searched for in the form.

If you look back to post #144 you will also see a recommendation of how to use the filter that is already set for the form. If this is what you want than it is probably an even easier solution.
Oct 8 '08 #160
puT3
145 100+
Oh i see...thanks...
Oct 9 '08 #161
NeoPa
32,556 Expert Mod 16PB
No worries :)

Let us know how this works for you.
Oct 9 '08 #162
NeoPa
32,556 Expert Mod 16PB
It works well..Another question is ...
If this thread is complete now (as it appears to be), I will split these new questions into (at least one) new threads (Delete Records from a Form).

I can include links across so that you can easily find them again.
Oct 10 '08 #163

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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.