ontopofmalvern
Registered User.
- Local time
 - Today, 04:57
 
- Joined
 - Mar 24, 2017
 
- Messages
 - 64
 
Hi when I run this code on an open Form the unbound text box called "txtBox" gets filled with the word "bob"
	
	
	
		
but when I run this on an open Report
	
	
	
		
I get the error "Argument not optional" (also VBA editor changes "Reports!" to "reports!" which I think is a clue ..)
I have a nasty workaround for my current problem using TempVars to pass the value to the Report then having an onload event like this
	
	
	
		
There must be a better way which I feel must be dead obvious but I can't find it.
 
		Code:
	
	
	Forms!frmMyForm!txtBox = "bob"
	but when I run this on an open Report
		Code:
	
	
	Reports!rptMyReprt!txtBox = "bob"
	I get the error "Argument not optional" (also VBA editor changes "Reports!" to "reports!" which I think is a clue ..)
I have a nasty workaround for my current problem using TempVars to pass the value to the Report then having an onload event like this
		Code:
	
	
	Me.txtBox = TempVars!strText
	There must be a better way which I feel must be dead obvious but I can't find it.