Auto populate field issue

M

martha

I am desperate for some help. I have 2 forms.

1. School
2. Venue

I am entering school names into the school field in the school form. I
want that information to automatically appear in the school field in
the venue form. I know nothing about VB. Can anyone help me?

For a temporary solution I put a refresh button on the school form so
after the information is entered into the school field you have to hit
refresh and then that adds the data to the school combo box in the
venue form.

Martha
 
J

Jeff Boyce

Martha

Microsoft Access does nothing (a slight over-exageration) without data.
Access stores data in tables, and you create forms and reports (and queries)
to add/edit/view the data in the tables.

There's no reason at all why putting data in the "school form" would make it
appear in the "venue form". That would depend entirely on which table the
data goes into, and on which table(s) your forms are looking to.

We might need a bit more explanation if you're looking for specific
suggestions...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
M

martha

On the school form I have a button that opens the venue form.

I am trying to figure out how to create a macro or some other method
that when I hit that button
It will take the data that is in the school field on the school form
and put it in the school field on the venue form.

I need the school name that is entered on the school form to be on
every other form.

Does this make sense?
 
J

John Vinson

On the school form I have a button that opens the venue form.

I am trying to figure out how to create a macro or some other method
that when I hit that button
It will take the data that is in the school field on the school form
and put it in the school field on the venue form.

I need the school name that is entered on the school form to be on
every other form.

Does this make sense?

How are the School and the Venue tables related - if at all?

You may want to make the Venue form a Subform of the School form
(rather than opening it independently as a stand-alone form). If each
School is related to one or more Venues, just use the unique SchoolID
as the master link field, and the foreign key SchoolID in the Venue
table as the Child Link Field.

John W. Vinson[MVP]
 
M

martha

Well, I thought of doing the subform thing but my issue gets bigger. I
have on the top level the School form, then many Venues for that school
and then attached to each Venue I have many Sports per venue. Any
recommendations would be extremely appreciated.
 
J

John Vinson

Well, I thought of doing the subform thing but my issue gets bigger. I
have on the top level the School form, then many Venues for that school
and then attached to each Venue I have many Sports per venue. Any
recommendations would be extremely appreciated.

I'm not sure what you're asking, Martha. You can put a subform on a
subform; or you can use "correlated subforms" - a mainform based on
Schools, one continuous subform based on Venues, and a second
continuous subform based on Sports. To do so, set the Master Link
Field of the sports subform to

=Forms![MainForm]![subVenue].Form![VenueID]

using the name of the subform control for subVenue and the unique id
of the venue table for VenueID; use the foreign key for VenueID as the
child link field.

Since it's not at all clear to me what you are trying to accomplish or
how you want the form to look, I'm groping in the dark here!

John W. Vinson[MVP]
 
D

Douglas J. Steele

Put a command on the form that's being used as a subform.

Am I missing something to your question?
 
J

John Vinson

Do you know if there is a way to embed a command button in a subform?

Sure. A subform's just a form; you can put any control on a Subform
that you can on a Form, including a command button.

Just use Continuous View rather than Datasheet to get full
flexibility.

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top