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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|