473,405 Members | 2,167 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.

Updating fields in a subform after user inputs number

Hello,
I have created a database that will eventually look up grades for a teacher. It is easier for me to learn if I actually have a project. So I took this one on for a friend who is a teacher. So far so good.

I am now creating a form which has a subform, and would like her to enter the student number and then the subform will update with that particular student, name , and number. i have looked at a lot of previous posts, but am too new to decipher exactly to my situation.

Any help or guided direction would be great. I am working in 2007.

Thank you in advance,

Sadie
Dec 15 '09 #1
4 1557
topher23
234 Expert 100+
Welcome Sadie!

I don't know how much of a beginner you are, so I'll explain this at a really basic level. Please don't be offended.

The key here is the linked fields between the parent form and the subform. When you open your parent form in design view, click on the subform and select the Data tab in your properties window. You'll want "Link Child Fields" set to the student number on the subform, and "Link Parent Fields" set to the text box on the parent form.

You'll also want to make sure the recordsource for the subform is set up to the table holding student information. The recordsource for the main form isn't material to the situation.

Now, click on the text box on your parent form. Go to the Properties window and click the Event tab, then click the ellipsis (...) at the end of AfterUpdate and select Code Builder. Paste in this code.
Expand|Select|Wrap|Line Numbers
  1. Me.[YourSubFormName].Requery
Replace YourSubFormName with the name of your subform control.

Now, when you type in a student number in the main form, the subform will check the records in its recordsource and display the record with that number.

I hope this helps!
Dec 15 '09 #2
I am trully a beginner that gets way over my head quickly. This helps alot and will try shortly to get it working.

Thank you,
Sadie
Dec 15 '09 #3
I got the subform and form working together. Thank you for your help. But now I added a field, in the main form so you could enter the student number and all fields will populate. I tried to do it in the fields that I just made work and can't get that to work so I added a field. Probably not the best approach. I have attached the db, maybe it would make more sense if you looked at it. It is the frmStudents.

Thank you again for your time and efforts.

Sadie
Attached Files
File Type: zip Annev6.zip (128.1 KB, 57 views)
Dec 16 '09 #4
I got it working, thank you for your help. All I had to do was change the fields I was looking for in the search button.

Thank you again,

Sadie
Dec 16 '09 #5

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

Similar topics

6
by: cyoung311 | last post by:
I'm trying to do an automatic update of one table from another through a form. Basically, when a selection is made for an item, in this case a particular workshop, I want to get the associated...
0
by: Paul T. Rong | last post by:
In form ˇ°Orderˇ± there are 4 important controls: - combo1 (unbounded, source from ProductID field of Product table), - txt1 (I wish the product name will automatic show here after the user inputs...
4
by: Laura | last post by:
Here's the situation: I'm trying to use an update query to copy data from one row to another. Here is the situation: I have 5 companies that are linked to each other. I need to show all 5...
5
by: Richard Stanton | last post by:
Hello all My database has a main form linked to table1. It has several subforms on the main form, all linked to table2. Table1 and Table2 are linked by primary/foreign key, no duplicates...
11
by: chrisc | last post by:
Hello, My infamous manufacturing database continues to bane my life, mostly because I'm really stumbling around in the dark here! What I am trying to do is populate some fields automatically...
4
by: froglog | last post by:
I have created a MS access DB to track transport costs for tax purposes. I enter data into a main form that tracks miles traveled by date with a subform . The subform has fields for the date...
0
by: anon1m0us | last post by:
Here is a code for ASP inputs being updated in Excel. However, when I click to submit the user, the excel does not get updated! <% @Language="VBScript" %> <% Dim con Dim rst Dim strCon Dim...
0
by: emalcolm_FLA | last post by:
Hello and TIA for any help with this non profit Christmas assistance project. I have an applicant (app history) and child (child history) tables (4 total). I need to grab the next available (in...
0
by: monicad82 | last post by:
I'm a beginner programmer and was tasked to create a form containing 1) a text box where a user enters number of cars and 2) a separate subform Some conditions: -If user enters more less than 1...
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
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
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.