How send pick data from a report to a form using VBA in Access 2007

Punice

Registered User.
Local time
Today, 02:22
Joined
May 10, 2010
Messages
135
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)
 
I think you should be using a form, select a control/record and process as you need.
 
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)
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.
 
Is it possible to incorporate VBA in a report to send record's picked field's data that is displayed to a form.
See example below
01. Open report
02. Click on any record of the report - form of this record will open ...
 

Attachments

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.
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 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.
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.

Typically, though, you would use a form, not a report, in this work flow. You could even embed that form as a subform in the header or footer of the base form and always filter it to show available brokers as the report would do.

Honestly, it's probably more a matter of the comfort level using the different objects than anything.
 
and here is another demo of what you required.
 

Attachments

I think you should be using a form, select a control/record and process as you need.
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.

Thank you for reading my post and responding to it.
 
Thanks to all for responding to my post. The two example databases are stored in my pc. They will save me from having to think or scour the 'net in the future.
 
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.
 
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.
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'.

This enables all of the broker's names to be included in the report, which is what I wanted.

I no longer need what I, initially, requested help on, with this post.

Again, thank you and all others. I do appreciate this wonderful source of solutions this site provides.
 

Users who are viewing this thread

Back
Top Bottom