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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refer to a 2nd level (sublevel) subform from a report

Status
Not open for further replies.

mrsbean

Technical User
Jul 14, 2004
203
US
I have the following code which does not work:

Code:
If IsNull(Form.frmCustomerOrder!subBillOfLading.Form!subBillOfLading2.Form!bProNumber) Or Form.frmCustomerOrder!subBillOfLading.Form!subBillOfLading2.Form!bProNumber = "" Then

Me.tblCarriers_subreport.Visible = False
Me.DraftBOL.Visible = True

End If

In either case (whether the value in the bProNumber box is null, not null, blank or completed, the report shows the same DraftBOL. Before the code fires, DraftBOL is invisible, and tblCarriers_subreport is visible.

MrsBean
 
Just making sure, have you tried returning the values of
Form.frmCustomerOrder!subBillOfLading.Form!subBillOfLading2.Form!bProNumber ????

See if it reads it correctly...
 
Also try this to shorten the code.

If trim(Form.frmCustomerOrder!subBillOfLading.Form!subBillOfLading2.Form!bProNumber & " ") = "" Then
Me.tblCarriers_subreport.Visible = False
Me.DraftBOL.Visible = True
End If
 
How are ya mrsbean . . .

Try this with direct subform objectivity:
Code:
[blue]   Dim BOL As Form, BOL2 As Form
   
   Set BOL = Forms.frmCustomerOrder!subBillOfLading.Form
   Set BOL2 = BOL!subBillOfLading2.Form
   
   If IsNull(BOL2!ProNumber) Or (BOL2!bProNumber = "") Then
      Me.tblCarriers_subreport.Visible = False
      Me.DraftBOL.Visible = True
   End If
   
   Set BOL2 = Nothing
   Set BOL = Nothing[/blue]

[blue]Your Thoughts? . . . [/blue]

Calvin.gif
See Ya! . . . . . .
 
Form[!]s![/!]frmCustomerOrder!subBillOfLading.Form!subBillOfLading2.Form!bProNumber

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks everybody. PHV, as always, you come up with great answers. Before I got back to look at this message board, I tried another approach and just used a DLookup. It worked, so I went with that.

I really appreciate the help.

MrsBean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top