Autofilling data

  • Thread starter Thread starter Rachel
  • Start date Start date
R

Rachel

Okay, I'm still struggling with this. Let me see if I can
clearly explain my problem and hopefully someone can help.
Please know that I have no background in programming, so
the more straightforward your answer the better. Thanks
Jim who tried to help me with my last question. I'm slowly
getting somewhere.

I have a database of kids who participate in our program.
I do two major things with this database. One, I enter new
kids, two I edit existing kids as new information comes in
on them. I have a few forms based on tables along with
queries that are all working fine.

Here are my questions.
1. When I open the form to enter a student the primary key
field is the student ID (although not the first one on the
form). Each student must have a unique ID based on three
or four letters and four numbers (eg - WOR0401 - WOR is
the agency, 04 is the year and 01 is their number in the
order of students from WOR). These numbers are generated
by me and eventually we'll have over 1000 entries and are
hard to keep straight. In a blank screen I want the data
to appear on a student if I pick a number that is already
in use. Otherwise I should be able to pick the number and
move forward. How do I make my existing form do this?

2. When I open the forms in edit mode it takes me to the
first student. I want to be able to pull up a student by
entering the student ID. I can't seem to get that to
happen AND have my box labeled properly in the design
field. I can get the wizard to help me make a combo box
that searches in the table but then I can't name the box
what I want and I'd really like a text box that I enter
the number in as opposed to a combo box.

3. I have a different form I use to invoice these
students. I have a field for Student ID, country, agent,
and agent code. How do I put together a query that will
auto fill in the country, agent, and agent code based on a
student ID. Again, the first three or four letters
identify the agent.

Thanks for your help.

Rachel
 
Place an UNBOUND combo box in the form header. Base this on a query where
you display the Student ID and the student names in ascending order. The
bound column is the ID field. Assume the combo box is named StudentSelect.
In the combo box's AfterUpdate event, add this code:

DoCmd.GoToControl "Student ID" (quotes are required)
DoCmd.FindRecord Me![StudentSelect]

When a selection is made from the unbound combo box the form will populate
with the record that includes the Student ID.

Con Giacomini
(e-mail address removed)
 
Back
Top