Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unbound Form Textbox in Report

Status
Not open for further replies.

ChrisCalvert

Technical User
Mar 18, 2002
231
US
Sorry to post what I see is a common question, but the answers I searched did not seem to come up with the answer I needed.

I have a form frmNewAgent I have a combo box that is unbound.
cboBusSysName. I need to pass this into a report. I am using this to set up new employees. The 'reports' are set up as replicas of paper forms that are requred to fax to different departments to get accesses set up, and this combo box is just who is 'signing off' on those forms. This does not need to be a permanent part of the employees record, but does need to print. I have set a text box on the report with the 'Control' property set to "=[Forms]![frmNewAgent]![cboBusSysName]". I am using some code to open the report :

Dim stDocName As String

stDocName = "rptDataAccess"

strWhere = "[EmpNo]=" & Me![EmpNo]

If [EmpNo] <> &quot;&quot; Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenReport strDocName, acViewPreview, , strWhere

Else
a = MsgBox(&quot;The form must contain valid data to print it.&quot;, vbOKOnly, &quot;Not enough data!&quot;)
End If


From what I read, the information on the 'Control' property should work, maybe it is the code?
SUggestions/Solutions appreciated

-chris
 
Hi Chris

At first sight you appear to be doing it right, what is the actual effect produced, do you get any error messages?

By Control property, you do mean .ControlSource don't you?

The Form is still open at the point when the report is openned isn't it?

Not much help I suspect.

Regards
Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
kenneth.reaySPAMNOT@talk21.com
remove SPAMNOT to use
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top