Passing value from form into report

G

Greg

I have an Order form. On that form I have a combo box and when I select last
name from that combo, box fields like address, phone, etc are populated.
I am using the following code to populate fields:
Private Sub Combo_From_AfterUpdate()
Me.From = Me.Combo_From.Column(1)
Me.Address1 = Me.Combo_From.Column(3)
Me.Zip = Me.Combo_From.Column(7)
etc
All those fields are unbounded and don’t have control source (customer
defined in customer database can place an order from different location) so
this is a reason I did not selected control source (sometimes I would like to
change address for example)

How do I pass for ex. address value to report? Tried dlookup: =DLookUp("
Forms![Car Order Form]","[Address1]") but gives me an error message
Thanks
 
P

paddy

Greg,

More than one way to skin a cat!

1.) Sometimes you need to reference the complete path in som
actions/methods. instead of Me./Me! try forms!formname!controlnam
(even if you are in "formname").

2.) Create a "Scratch" form that you can use to store values. Open th
Scratch form as hidden. Then you can use:

forms!scratch!controlname = me![controlname]. And then [controlname
=forms!scratch!controlname.

Ofcourse you will need to populate the scratch form with the variou
textbox controls (unbound) to store the needed info. and to write t
that control before calling the other form/report.

eg.
On the scratch form have a control named "Address". In the Report hav
a control named "rptAddress". Then when you need it, [rptAddress]
forms!scratch!Address.

In the past I have found, in some cases, this is the only way to d
some things.

Good luck

Patric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top