473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Retrival of records from a table

10
Hi I am new using Access database. I have created a table with several fields like (letter categrory, letter type, letter name etc) in access, using forms and inserted few records in my table. now I wanted to know like if i type in an existing letter name(already placed in a record) in the text field provided for letter name in my form, I need to retrive all other fields of that particular record.

say for example, my record has
Letter categrory : intr
Letter type : haaad
Letter Name : abcdef

Now if i type in abcdef for letter name in my forms window, the forms window should display values of letter type and letter name.
how do i do this
Jan 29 '09 #1
12 1388
orangeCat
83 64KB
@shreeks
Here is a link that could be useful to you.

http://www.allenbrowne.com/casu-22.html
Jan 29 '09 #2
ChipR
1,287 Expert 1GB
Well, here are some suggestions if you don't want to read a whole book.

If you are ok with your user having to input the exact letter name to search, you can make a subform to display the records and set its Link Master Fields to the input textbox and the Link Child Fields to LetterName. This is a bit restrictive.

Another way would be to have the user type in a value and click a search button. The code in the search button is like:
Expand|Select|Wrap|Line Numbers
  1. subformControlName.Form.Filter = "LetterName LIKE '" _
  2. & [inputTxtBox] & "*'"
  3. subformControlName.Form.FilterOn = True
So, when they click search, your subform now only displays those records that have a Letter Name that starts with what was entered in the text box.
Later on, you can get fancy and update the subform whenever a letter is typed in the input, like an autocomplete, depending on how large your recordset is.
Jan 29 '09 #3
shreeks
10
I Created another form say 2nd form with Letter name, and made my original form with letter type, letter category and letter name as the subform. Acutually my Letter name field is set as primary key. Now i entered few values in the table and I am able to retrive the values of the table using my 2nd form by entering the letter name already existing in my table and I am able to see all the values in the subform.
let us say my table has
Letter name letter type letter category
andy aaa 123
sam bbb 333
rob ccc 324

when i enter 'andy' into the letter name i am able to see 'aaa' and '123' in my subform.
but now i want to edit this data in my subform. I want to change 'aaa' and '123' values in my subform directly and this change should reflect in my table.
can I do that, or is there any other method that i can work on that performs this job??
Feb 2 '09 #4
ChipR
1,287 Expert 1GB
The data in the subform is the table data, so if you change it in the subform, it will be updated in the table. What is preventing you from changing the data in the subform now?
Feb 2 '09 #5
shreeks
10
Acutually I have setup "Primary Key" on Letter Name field. So it is popping out a message like... " the changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the fields that contain duplicate data, remove the index or redefine the index to permit duplicate entries and try again"

but I dont want duplicates in my table....
Feb 2 '09 #6
ChipR
1,287 Expert 1GB
You get this message when you try to change the data in the subform? Change one field at a time until you can tell what field is violating the restrictions.
Feb 2 '09 #7
shreeks
10
Acutully here I am not entering the new data ... i am trying to edit the data which is popped up from the table in the subform.

I am not being allowed to edit any data there... I am getting the message as soon as I am trying to click my mouse anywhere on the subform.
Feb 2 '09 #8
ChipR
1,287 Expert 1GB
What code are you using to show the values in the subform?
Feb 2 '09 #9
shreeks
10
I didnt write any code there... I just dragged one form into another in design view .... one of my forms has just letter name in it and other form has letter name, letter type and letter description in it.. i dragged the second form and placed it in the first form... so when i type in a letter name in my first form.. the corrosponding record values are being displayed in the subform.....
so I haven't written any code there...
Could you please help me out writing out the code(please be very elobrative beccause this is my first time working on access)......
Feb 2 '09 #10
ChipR
1,287 Expert 1GB
Is your first form bound to a recordset? The field where you type in a letter name on your form should not be updating your table.
Feb 2 '09 #11
shreeks
10
yes my first form is also bound to a record set. yes it is not updating my table..
Feb 2 '09 #12
ChipR
1,287 Expert 1GB
Try removing the recordset source from the main form. It doesn't need one. Make sure that the master field of the subform is set to your input box.
Feb 2 '09 #13

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

Similar topics

8
by: tom | last post by:
I am new to SQL administration. >From a list of IDs that are the primary key in one table (i.e. Customer Table), I want to make changes in tables that use those IDs as a foreign key. ...
20
by: Guru | last post by:
Hi I have a table which contains number of rows. I want to fetch the last 5 records from the table. I know for the first 'n' records we can use FETCH FIRST n ROWS ONLY command. But i want to...
4
by: Scott Kinney | last post by:
I have an inventory database. I want to delete out-of-stock items from the main database, but keep them in a separate table so that I can reference data about them. I created a copy of the item...
6
by: Robin S. | last post by:
**Eric and Salad - thank you both for the polite kick in the butt. I hope I've done a better job of explaining myself below. I am trying to produce a form to add products to a table (new...
6
by: Paul T. Rong | last post by:
Dear all, Here is my problem: There is a table "products" in my access database, since some of the products are out of date and stopped manufacture, I would like to delete those PRODUCTS from...
5
by: -:= Cactus | last post by:
Hi! I've made a form for dataentry in a simple table. However when there are records in that table and I open the form it only displays the new (blank) record. The total number of records is 1,...
3
by: Chris H | last post by:
Ok in the following code I am trying to have my keywards meta tag auto insert the top 10 titles from most recently added database entries, right now the while loop is only setting the $keyword...
18
by: ashutoshvyas | last post by:
I want to write such criteria in the query of microsoft ACCESS, which can give records with secondlast date? table & fields............desired output no-name-date..............name-date...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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
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,...

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.