Open Form with Information from Multiple IDs

Nadine67

Board Regular
Joined
May 27, 2015
Messages
225
Hello and thankyou for any attention my post may receive.

I have a db with numerous objects - three of which are tblMain, frmCapture,frmReadOnly.

When the user opens frmReadOnly I would like the from to not only populate withthe appropriate information according to the ID but also with information fromother IDs which meet a criteria.

This is the code I have to currently open frmReadOnly.
Code:
[COLOR=#222222][FONT=Verdana]Private SubCommand2_Click()<o:p></o:p>[/FONT][/COLOR]
[COLOR=#222222][FONT=Verdana]DoCmd.OpenForm"frmReadOnly", , , "ImprovementID = " &Me!txtSelectView<o:p></o:p>[/FONT][/COLOR]
[COLOR=#222222][FONT=Verdana]End Sub<o:p></o:p>[/FONT][/COLOR]


The extra information I would like the form to populate with is stored incolumn 1 on tblMain however the columns containing the search-criteria arecolumns 51,52,53 in tblMain. The information in these three columnsis numerical values which will match the ID of frmReadOnly. So basicallywhere #10 appears in these three columns I would like the ID #s for thoserecords to appear on frmReadOnly #10 in either three separate fields or ideallyconcatenated with separators in a single field.

Is this possible?

Thank you and have a great day!
<o:p></o:p>
 
The simplest way to show data from multiple columns in one field is to create a calculated field at the level of the query that sources the form:

Code:
select Col51 & Col52 & Col53 as MyNewField from MyTable

Then you display the new field in your form.

Of course you have to worry about data types to make sure the concatenation works correctly - different data types require different syntax for the concatenation
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
*** SOLVED ***

Thank you xenou!

I can certainly accommodate this on my form. You have made my day.

Thank you once again and have a great day.
 
Upvote 0

Forum statistics

Threads
1,223,981
Messages
6,175,768
Members
452,668
Latest member
mrider123

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