Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-17-2018, 07:56 AM   #1
Jonathan Suthard
Newly Registered User
 
Join Date: May 2018
Posts: 12
Thanks: 5
Thanked 0 Times in 0 Posts
Jonathan Suthard is on a distinguished road
Auto populate a form

What is the best/easiest way to populate a form with a list of names that all have the same field in their record...

I have a combo that reflects a field on a table. I need to populate a form with names based on this combo box selection.

Jonathan Suthard is offline   Reply With Quote
Old 05-17-2018, 08:17 AM   #2
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,179
Thanks: 39
Thanked 3,292 Times in 3,188 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Auto populate a form

can you clarify your terminology - names of what?
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 05-17-2018, 08:33 AM   #3
Jonathan Suthard
Newly Registered User
 
Join Date: May 2018
Posts: 12
Thanks: 5
Thanked 0 Times in 0 Posts
Jonathan Suthard is on a distinguished road
Re: Auto populate a form

Names of students stored in a table that has a specific field common to them such as...1st period

Jonathan Suthard is offline   Reply With Quote
Old 05-17-2018, 11:10 AM   #4
CJ_London
Super Moderator
 
Join Date: Feb 2013
Location: UK
Posts: 10,179
Thanks: 39
Thanked 3,292 Times in 3,188 Posts
CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice CJ_London is just really nice
Re: Auto populate a form

still unclear, you seem to be saying

populate a form with a list of names that all have the same name in their record..

perhaps provide an example of the data and the outcome required - at the moment it sounds like your example data is

John Smith
Harry Smith
Henry James
Harry Smith

and what you want is

Harry Smith
__________________
CJ_London
_______________________
A little thanks goes a long way. If you have found this post useful, please tick the thanks button
CJ_London is offline   Reply With Quote
Old 05-17-2018, 11:16 AM   #5
nhorton79
Newly Registered User
 
Join Date: Aug 2015
Posts: 57
Thanks: 8
Thanked 3 Times in 3 Posts
nhorton79 is on a distinguished road
Re: Auto populate a form

Usually a form doesn’t display multiple records of the same type.

If you want to display all the records (names) of a particular type it is best IMHO to use a listbox. Or use a subform.


Nick
Sent from my iPhone using Tapatalk
nhorton79 is offline   Reply With Quote
Old 05-17-2018, 11:24 AM   #6
Jonathan Suthard
Newly Registered User
 
Join Date: May 2018
Posts: 12
Thanks: 5
Thanked 0 Times in 0 Posts
Jonathan Suthard is on a distinguished road
Re: Auto populate a form

CJ,

I have a table with student names on it, this table contains several columns (fields) all with different data.

One of the columns contains the class period those students are in. I need to populate a form with all of the names from a specific class period.


ID Last First Class
123 Jones Sally 1st
112 Jones Bill 2nd
154 Koner Jayson 1st
145 Koner Jamie 2nd
157 Lavern Suzie 1st


I need to populate a form by selecting "1st" either from a combo box or a list box.

What I need is...
123 Jones Sally
154 Koner Jayson
157 Lavern Suzie

Hope this clarifies the situation
Jonathan Suthard is offline   Reply With Quote
Old 05-17-2018, 02:25 PM   #7
Pat Hartman
Super Moderator
 
Join Date: Feb 2002
Location: Stratford,Ct USA
Posts: 27,321
Thanks: 13
Thanked 1,396 Times in 1,330 Posts
Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light Pat Hartman is a glorious beacon of light
Re: Auto populate a form

Create an unbound main form to hold the selection criteria and a bound subform in DS view to display the selection.

The RecordSource for the subform should be a query with a WHERE clause that references the combo on the main form.

Select ...
From ..
WHERE ClassID = Forms!yourformname!cboClassID

If there is only one criteria, then in the AfterUpdate event of the combo, requery the subform.

Me.Mysubformname.Requery

If there are multiple criteria, use a button to requery the subform.

__________________
Bridge Players Still Know All the Tricks
Pat Hartman is offline   Reply With Quote
The Following User Says Thank You to Pat Hartman For This Useful Post:
Jonathan Suthard (05-18-2018)
Old 05-18-2018, 04:00 AM   #8
Jonathan Suthard
Newly Registered User
 
Join Date: May 2018
Posts: 12
Thanks: 5
Thanked 0 Times in 0 Posts
Jonathan Suthard is on a distinguished road
Re: Auto populate a form

Pat,

Thank you very much! I knew it could be done just didn't know how to do it. Not sure my knowledge level in Access will make this easy or not...more than likely not. However, I am going to give it a shot today!!!


Thanks again!

Jonathan Suthard is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Populate form npatel Forms 4 10-02-2016 03:18 PM
Auto Populate Form mlozano Forms 1 06-16-2016 06:48 AM
auto populate on form John thomas Forms 5 09-23-2013 12:00 PM
Auto Populate Next Form mateogp Forms 1 11-11-2005 05:20 PM
Auto populate form verschup Forms 7 03-24-2004 07:00 AM




All times are GMT -8. The time now is 07:00 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Sponsored Links

How to advertise

Media Kit


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World