Controling the output on a form

Fletchmeister

Board Regular
Joined
May 20, 2003
Messages
114
I have a combo box connected to a table that has address in it. this has in it -

Code
Company Name
Add1
Add2
Add3
P/Code
TEL
FAX
e-mail

When choosing the drop down list I only want the code and sol name to appear which I can do. However after choosing them I want it to display the full address somehow on my form in the above format with eahc line underneath the other. There has got to be a simple solution to this that I am missing!

Can someone help please???

:oops:
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
First make sure the form is set to "Single Form" in the default view.

Layout your field labels as you want them. Then from the toolbox place a new combobox (using the wizard) Choose to "Find" a record (3rd choice). follow the steps.

This should do the trick

Ziggy
 
Upvote 0
Is your form bound to this table? If so, this should be easy. You have text boxes on your form, each box bound to one of your table's fields, right? You format these text boxes the way that you like (one on top of the other is what you seem to want here) and then you can use this generic bit of VBA code in a procedure behind the combo box:
Code:
Your_Combo_AfterUpdate()
Dim RS As Object
Set RS = Me.RecordsetClone
RS.findfirst "[Your_Form_Primary_Key] = " & Me![Your_Combo's_Bound_Column]
Me.Bookmark = RS.Bookmark
Set RS = Nothing
I believe that your field "Code" is your primary key, but I'm not sure. Either way, the form's primary key and the combo box's Bound Column will be the same field in the underlying table.

*edit* Ziggy's suggestion and mine are exactly the same except the wizard will write this code for you.
 
Upvote 0

Forum statistics

Threads
1,221,532
Messages
6,160,381
Members
451,643
Latest member
nachohoyu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top