Assigning textbox value...

1

116

I am writing a report. The report is unbound. I am attempting to use VB
(dlookup) to gather data so I may populate the report textboxes. The dlookup
appears to be working fine. I can see the data in the immediate window. But
when I attempt to assign findings to textbox, I get 'can not assign to this
object'. Any help would be gratly appreciaited.

Thanks
David
 
1

116

Thanks for the quick response Steve. I created a new report unbound with
only one textbox, also unbound. I used

CO1 = DLookup("[Company]", "q_JB Supplier AS 9100 Contacts", "[Company]")

txtCompany = CO1

and I am receiving the same error.
 
J

John W. Vinson

Thanks for the quick response Steve. I created a new report unbound with
only one textbox, also unbound. I used

CO1 = DLookup("[Company]", "q_JB Supplier AS 9100 Contacts", "[Company]")

txtCompany = CO1

and I am receiving the same error.

Turn your logic around.

Set the Control Source of txtCompany to

= DLookup("[Company]", "q_JB Supplier AS 9100 Contacts", "[Company]")

If you do need to "push" values into controls on a report, I think you'll need
to put code in the Report's Open event, and use

Me!txtCompany = DLookUp(...
 
1

116

Thanks, I did think of that. That works. The reason I am looking into this,
is that I have address1, 2, 3. 2 & 3 can be blank, and I wanted to (If,
then) in the event they are blank. This would remove those gaps on the
report.

John W. Vinson said:
Thanks for the quick response Steve. I created a new report unbound with
only one textbox, also unbound. I used

CO1 = DLookup("[Company]", "q_JB Supplier AS 9100 Contacts", "[Company]")

txtCompany = CO1

and I am receiving the same error.

Turn your logic around.

Set the Control Source of txtCompany to

= DLookup("[Company]", "q_JB Supplier AS 9100 Contacts", "[Company]")

If you do need to "push" values into controls on a report, I think you'll need
to put code in the Report's Open event, and use

Me!txtCompany = DLookUp(...
 

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