This is actually the reverse workflow from the way forms and reports are designed to work.Is it possible to incorporate VBA in a report to send record's picked field's data that is displayed to a form.
If so, please show me an example(s)
See example belowIs it possible to incorporate VBA in a report to send record's picked field's data that is displayed to a form.
I understand what you wrote. Here is what I was hoping to achieve, if what I asked was possible.This is actually the reverse workflow from the way forms and reports are designed to work.
Forms are the dynamic objects through which users interact with data. Report are essentially used to display data.
Therefore, it would be helpful to know why you want to go against design to accomplish this. Perhaps it's possible to accomplish your real goal in a more direct manner.
If, by report, you actually mean a report object, then it is possible to use it as you wish, but only if you open it in Report View, not Print Preview. There are limited events available in Report View. I haven't looked into the sample Eugene provided, but if it works that way, you could adapt it.I understand what you wrote. Here is what I was hoping to achieve, if what I asked was possible.
I'm a trucking company person entering data in a new form that will include all of the information pertaining to a load, such as: the name of the broker I will use, eventually, pickup location, pickup date, destination location and the material that will be hauled.
In the past, I have used numerous brokers to haul the same load and, now, I want to use one of them, without having to select them from a lengthy combo-box list.
The current form permits me to enter the material, which opens a report listing all of the records that contain the brokers names, pickup dates, etc, that I've used to haul that same material.
I was hoping to be able to pick, on the report, the broker name that I want to use for this trip and have it appear in the broker name field on the loads form.
That's all. Thanks.
I did use a form that held the broker names in a combo-box, starting in 2011. Now, that list contains 460 broker names that I can select from. It is a PIA to scroll down through all of them and associate the material with the brokers that I used to haul the material previously, to select which broker I want to use for this particular load.I think you should be using a form, select a control/record and process as you need.
I did something like what you suggested in a query to restrict the sort, in descending chronological order, by "Pickup Date', to isolate the broker names to those who were used to haul the material entered in the loads form. I entered this: "[Forms]![frmLOADS]![Material]" in the criteria field of the 'Material' field of the query that the report's 'Record Source'.You can add a field to the shipper RowSource and sort first by the new field and then by the name. You don't need to show the new field or even select it. It isn't necessary to assign numbers to all of them. You just need to assign numbers to the few you want to pop to the top. If the default is null, sort descending so the three 1's sort to the top.