A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Displaying Data in a Form



 
 
Thread Tools Display Modes
  #1  
Old December 1st, 2009, 08:29 PM posted to microsoft.public.access.forms
Marsh
external usenet poster
 
Posts: 108
Default Displaying Data in a Form

Using Access 2007, we have a form that has 14 controls bound to fields in a
table.
What we need to do find a method where a user picks a value from a ComboBox
which is one of the 14 above mentioned controls, and have the other controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh
  #2  
Old December 1st, 2009, 11:33 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Displaying Data in a Form

Marsh

Depending on your specific needs, consider the following variation on your
request ...

If your combobox holds "LastName, FirstName", you'd be less likely to have
to sift through 9 "Smith" records to find the one you want. Of course, you
could still have two "Smith, John" entries, so also displaying the address
might help further narrow the selection...

.... until you're faced with a father & son, both named John Smith, both
living at the same address!

One way to do what you're describing is to NOT bind that combobox to a
field. Instead, use a query that returns PersonID and LastName, with
PersonID (or whatever you call it) not displayed (width=0). Then, in the
AfterUpdate event of that combobox (usually placed in the Header), requery
the form with:
Me.Requery

You'll need to modify the form to have it 'fed' by a query rather than
directly by the table. And in that query, you can put something like the
following reference to the combobox, so the query returns only the record
selected in the combobox:

Forms!YourFormName!cboYourComboboxName

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Marsh" wrote in message
...
Using Access 2007, we have a form that has 14 controls bound to fields in
a
table.
What we need to do find a method where a user picks a value from a
ComboBox
which is one of the 14 above mentioned controls, and have the other
controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when
Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh



  #3  
Old December 1st, 2009, 11:33 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Displaying Data in a Form

Marsh

Depending on your specific needs, consider the following variation on your
request ...

If your combobox holds "LastName, FirstName", you'd be less likely to have
to sift through 9 "Smith" records to find the one you want. Of course, you
could still have two "Smith, John" entries, so also displaying the address
might help further narrow the selection...

.... until you're faced with a father & son, both named John Smith, both
living at the same address!

One way to do what you're describing is to NOT bind that combobox to a
field. Instead, use a query that returns PersonID and LastName, with
PersonID (or whatever you call it) not displayed (width=0). Then, in the
AfterUpdate event of that combobox (usually placed in the Header), requery
the form with:
Me.Requery

You'll need to modify the form to have it 'fed' by a query rather than
directly by the table. And in that query, you can put something like the
following reference to the combobox, so the query returns only the record
selected in the combobox:

Forms!YourFormName!cboYourComboboxName

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Marsh" wrote in message
...
Using Access 2007, we have a form that has 14 controls bound to fields in
a
table.
What we need to do find a method where a user picks a value from a
ComboBox
which is one of the 14 above mentioned controls, and have the other
controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when
Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh



  #4  
Old December 1st, 2009, 11:33 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Displaying Data in a Form

Marsh

Depending on your specific needs, consider the following variation on your
request ...

If your combobox holds "LastName, FirstName", you'd be less likely to have
to sift through 9 "Smith" records to find the one you want. Of course, you
could still have two "Smith, John" entries, so also displaying the address
might help further narrow the selection...

.... until you're faced with a father & son, both named John Smith, both
living at the same address!

One way to do what you're describing is to NOT bind that combobox to a
field. Instead, use a query that returns PersonID and LastName, with
PersonID (or whatever you call it) not displayed (width=0). Then, in the
AfterUpdate event of that combobox (usually placed in the Header), requery
the form with:
Me.Requery

You'll need to modify the form to have it 'fed' by a query rather than
directly by the table. And in that query, you can put something like the
following reference to the combobox, so the query returns only the record
selected in the combobox:

Forms!YourFormName!cboYourComboboxName

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Marsh" wrote in message
...
Using Access 2007, we have a form that has 14 controls bound to fields in
a
table.
What we need to do find a method where a user picks a value from a
ComboBox
which is one of the 14 above mentioned controls, and have the other
controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when
Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh



  #5  
Old December 2nd, 2009, 03:09 PM posted to microsoft.public.access.forms
Marsh
external usenet poster
 
Posts: 108
Default Displaying Data in a Form

Thank you very much - that was easy once I figured out where to put the
Me.Requery code. I am not even a VBA novice.

"Jeff Boyce" wrote:

Marsh

Depending on your specific needs, consider the following variation on your
request ...

If your combobox holds "LastName, FirstName", you'd be less likely to have
to sift through 9 "Smith" records to find the one you want. Of course, you
could still have two "Smith, John" entries, so also displaying the address
might help further narrow the selection...

.... until you're faced with a father & son, both named John Smith, both
living at the same address!

One way to do what you're describing is to NOT bind that combobox to a
field. Instead, use a query that returns PersonID and LastName, with
PersonID (or whatever you call it) not displayed (width=0). Then, in the
AfterUpdate event of that combobox (usually placed in the Header), requery
the form with:
Me.Requery

You'll need to modify the form to have it 'fed' by a query rather than
directly by the table. And in that query, you can put something like the
following reference to the combobox, so the query returns only the record
selected in the combobox:

Forms!YourFormName!cboYourComboboxName

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Marsh" wrote in message
...
Using Access 2007, we have a form that has 14 controls bound to fields in
a
table.
What we need to do find a method where a user picks a value from a
ComboBox
which is one of the 14 above mentioned controls, and have the other
controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when
Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh



.

  #6  
Old December 2nd, 2009, 03:09 PM posted to microsoft.public.access.forms
Marsh
external usenet poster
 
Posts: 108
Default Displaying Data in a Form

Thank you very much - that was easy once I figured out where to put the
Me.Requery code. I am not even a VBA novice.

"Jeff Boyce" wrote:

Marsh

Depending on your specific needs, consider the following variation on your
request ...

If your combobox holds "LastName, FirstName", you'd be less likely to have
to sift through 9 "Smith" records to find the one you want. Of course, you
could still have two "Smith, John" entries, so also displaying the address
might help further narrow the selection...

.... until you're faced with a father & son, both named John Smith, both
living at the same address!

One way to do what you're describing is to NOT bind that combobox to a
field. Instead, use a query that returns PersonID and LastName, with
PersonID (or whatever you call it) not displayed (width=0). Then, in the
AfterUpdate event of that combobox (usually placed in the Header), requery
the form with:
Me.Requery

You'll need to modify the form to have it 'fed' by a query rather than
directly by the table. And in that query, you can put something like the
following reference to the combobox, so the query returns only the record
selected in the combobox:

Forms!YourFormName!cboYourComboboxName

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Marsh" wrote in message
...
Using Access 2007, we have a form that has 14 controls bound to fields in
a
table.
What we need to do find a method where a user picks a value from a
ComboBox
which is one of the 14 above mentioned controls, and have the other
controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when
Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh



.

  #7  
Old December 2nd, 2009, 03:09 PM posted to microsoft.public.access.forms
Marsh
external usenet poster
 
Posts: 108
Default Displaying Data in a Form

Thank you very much - that was easy once I figured out where to put the
Me.Requery code. I am not even a VBA novice.

"Jeff Boyce" wrote:

Marsh

Depending on your specific needs, consider the following variation on your
request ...

If your combobox holds "LastName, FirstName", you'd be less likely to have
to sift through 9 "Smith" records to find the one you want. Of course, you
could still have two "Smith, John" entries, so also displaying the address
might help further narrow the selection...

.... until you're faced with a father & son, both named John Smith, both
living at the same address!

One way to do what you're describing is to NOT bind that combobox to a
field. Instead, use a query that returns PersonID and LastName, with
PersonID (or whatever you call it) not displayed (width=0). Then, in the
AfterUpdate event of that combobox (usually placed in the Header), requery
the form with:
Me.Requery

You'll need to modify the form to have it 'fed' by a query rather than
directly by the table. And in that query, you can put something like the
following reference to the combobox, so the query returns only the record
selected in the combobox:

Forms!YourFormName!cboYourComboboxName

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Marsh" wrote in message
...
Using Access 2007, we have a form that has 14 controls bound to fields in
a
table.
What we need to do find a method where a user picks a value from a
ComboBox
which is one of the 14 above mentioned controls, and have the other
controls
populated with the appropriate data.
A simplistic example is to have a combo box with last names, and when
Smith
is chosen from the drop down 9 records with the last name Smith are
available in the form. I can then navigate through the various Smiths and
find the First Name, Address, City, State, Zip, etc for any of the Smiths.
Thanks in advance for any suggestions
Marsh



.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:45 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.