473,396 Members | 1,966 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,396 software developers and data experts.

Find Record in Table and Return Values

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_Assignment.

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_Assignment, 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_Assignment, 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 6458
Minion
108 Expert 100+
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_Assignment.

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_Assignment, 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_Assignment, 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
This additional form must have fried some brain cells cause some reason I just can't get this.

Form Name: F:Claims_Assignment_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_Assignment 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 Expert 100+
This additional form must have fried some brain cells cause some reason I just can't get this.

Form Name: F:Claims_Assignment_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_Assignment 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 "ClaimNumber" 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
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...
3
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: ...
8
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...
3
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...
1
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...
6
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...
7
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...
1
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...
1
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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,...

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.