473,789 Members | 2,550 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Find Record in Table and Return Values

20 New Member
I'm working on a database created in Access 97 which has a form which tracks claims made for damages. When the person reports the claim, a form is used to enter Date Reported, Claim Number, Loss Type, Reported To, and Caller Name. This information is recorded into tbl:Claims_Assi gnment.

I've been asked to create a form, to correct these initial details if entered incorrectly, so the end user doesn't have to go into tbl:Claims_Assi gnment, find the record and make appropriate corrections. (There’s over 5000 entries in this table thus far)

Example:
Date Reported: Dec. 12/07 (textbox)
Claim Number: 121212 (textbox)
Loss Type: Damaged in transit (Combobox) (Should have been “Water”)
Reported To: John (Combobox) (Should have been "James")
Caller Name: Mary (textbox)

On the form I was attempting to create, I want to have a textbox where the user would enter in the claim number and afterupdate, it would search the tbl:Claims_Assi gnment, find the record and return the initial information for editing.

On the new form I have a textbox to input claim number, then the same fields as on the original frm:Main

I’m fairly new at this and not sure if I have to create a macro, a code, or a query to get this information and from what I’ve read and attempted, I just can’t seem to make this work.
Dec 13 '07 #1
4 6488
Minion
108 Recognized Expert New Member
I'm working on a database created in Access 97 which has a form which tracks claims made for damages. When the person reports the claim, a form is used to enter Date Reported, Claim Number, Loss Type, Reported To, and Caller Name. This information is recorded into tbl:Claims_Assi gnment.

I've been asked to create a form, to correct these initial details if entered incorrectly, so the end user doesn't have to go into tbl:Claims_Assi gnment, find the record and make appropriate corrections. (There’s over 5000 entries in this table thus far)

Example:
Date Reported: Dec. 12/07 (textbox)
Claim Number: 121212 (textbox)
Loss Type: Damaged in transit (Combobox) (Should have been “Water”)
Reported To: John (Combobox) (Should have been "James")
Caller Name: Mary (textbox)

On the form I was attempting to create, I want to have a textbox where the user would enter in the claim number and afterupdate, it would search the tbl:Claims_Assi gnment, find the record and return the initial information for editing.

On the new form I have a textbox to input claim number, then the same fields as on the original frm:Main

I’m fairly new at this and not sure if I have to create a macro, a code, or a query to get this information and from what I’ve read and attempted, I just can’t seem to make this work.
This should be relatively easy to do. What you will need to do is apply a filter to the records using the value inputed into the text box. The code would look something like:

Expand|Select|Wrap|Line Numbers
  1. sub txtBox_LostFocus()
  2.  
  3.    DoCmd.ApplyFilter, "ClaimNumber = " & txtBox.Value
  4.    DoCmd.Requery "Form Name"
  5.  
  6. end sub
  7.  
This should set the filter for the recordset to only find the record corresponding the claim number.

Hope this helps.

- Minion -
Dec 13 '07 #2
bruce24444
20 New Member
This additional form must have fried some brain cells cause some reason I just can't get this.

Form Name: F:Claims_Assign ment_Mtce
At the top is a textbox named: Text1
Then a command button to apply a filter
On click, of this command button, I want it to find the Claim Number entered in the text box and fill in the remainder of the form which contains fields linked to tbl:Claims_Assi gnment with textboxes for Claim Number, Reported To, Loss Type, etc

Again I apologize, I'm just completely frustrated and can't get it to do what I need.
Dec 13 '07 #3
Minion
108 Recognized Expert New Member
This additional form must have fried some brain cells cause some reason I just can't get this.

Form Name: F:Claims_Assign ment_Mtce
At the top is a textbox named: Text1
Then a command button to apply a filter
On click, of this command button, I want it to find the Claim Number entered in the text box and fill in the remainder of the form which contains fields linked to tbl:Claims_Assi gnment with textboxes for Claim Number, Reported To, Loss Type, etc

Again I apologize, I'm just completely frustrated and can't get it to do what I need.

My apologies. I had posted the code I used when opening forms to a particular record.I've gone back and tested the following with one of my projects. Hopefully these two lines will do it for you.

Just add this code to your command button and make sure the values are correct for your project and I think you'll have it.

Expand|Select|Wrap|Line Numbers
  1. Private Sub CommandButton_Click()
  2.  
  3.     Me.Filter = "ClaimNumber = '" & Me.Text1.Value & "'"
  4.     Me.FilterOn = True
  5.  
  6. End Sub
  7.  
Just make sure to set the field name "ClaimNumbe r" to whatever you called the field in your connected table.

Hope this helps.

- Minion -
Dec 17 '07 #4
THANK YOU SO much
i have been working on the same problem for 3weeks and this thread found me the answer! You have made me soooo happy!
Oct 26 '10 #5

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

Similar topics

2
4510
by: Mansoor Azam | last post by:
I have 2 tables say table1 and table2 with the same structure. Each record is identified by a field 'SerialNo'. Now there should be a total of 500000 records in both tables with serialno from 1 to 500000. Either a record is in table1 or table2. I want to find records (or SerialNo's) that are in neither table (if deleted by accident etc). What would be the sql query? I'm using SQL 6.5 thx
3
4612
by: Tom Mitchell | last post by:
All: I'm stumped on a query. How do I find duplicates in a table where one of the duplicates has values is a certain field and the other doesn't. For example, I have the following table: tblItems ItemID ItemLabel
8
3309
by: Mark | last post by:
When my form goes to a new record, I have a procedure that copies the last record added to the form's underlying table into the form. The intent is that a series of new records may have the same data in many of the fields so I paste in the same values of the previous record and then edit what needs edited in the new record saving much retyping of the same data. Doing this however creates the definite possibility of creating a duplicate...
3
1313
by: TheDude5B | last post by:
Hi, i am wanting to add some data to one table within my MySQL database using asp.net in VB, however, i want to also add some of the same data to another table at the same time. Easy yes, but one field within the second table must contain the unique ID of the record which has just been created in the other table. For example. table 1 will contain: name, address, tel, email etc...
1
2265
by: Daniel Martini | last post by:
Hi all, I'm currently coding some functions in plpgsql for generating reports out of records in a table. Problem is: NULL values in records make the complete function fail. Here is a simple test case (original is more complex with a multi- table query in the for qres in select... part): create table test( id serial,
6
2700
by: jrpfinch | last post by:
I have a table with two columns: siteID (int primary key) and siteName (varchar(50) unique constraint). I am completely new to databases and UDFs and would like to write a function that looks for a particular siteName and returns the siteID. If the siteName is not found then it would create a record and return that record's siteID. I am pretty sure there is a standard way of doing it and have been looking for examples, but have yet to...
7
4540
by: john | last post by:
In my form I have a master table and a details table linked 1xM. I can search through the whole parent table but I also like to be able to search through the child table fields to find parent records. Should I design a new form for this or can I somehow make this work in the same form. Thanks in advance, john
1
2488
by: aknoch | last post by:
My basic situation is this - I ONLY want duplicates, so the opposite of DISTINCT: I have two tables. Ordinarily, Table1ColumnA corresponds in a one to one ratio with Table2ColumnB through a shared variable. So if I query TableB using the shared variable, there really should only be on record returned. In essence, if I run this and return TWO rows, it is very bad: select * from TableB where SharedVariable = 1234
1
4611
by: javediq143 | last post by:
Hi All, This is my first post in this forum. I'm developing a CMS for my latest website. This CMS is also in PhP & MySQL. I'm done with the ADD section where the Admin can INSERT new records in Database but I'm stuck in the EDIT. I'm getting 2 problems over here. Below is the description: 1)The FIRST page will list all the records from the table which Admin can EDIT with CHECKBOX for each record to select. He can select one or more than one...
0
9663
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9511
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10195
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9979
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6765
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4090
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 we have to send another system
2
3695
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2906
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.