subform from form

  • Thread starter Thread starter idic5
  • Start date Start date
I

idic5

Guest
How do I conditionally execute a subform from another form? We have formA executing formB. FormB's datasource is a query where fieldB is set to a value or to null.

In formB, I want to say: If fieldB is null, execute formC, otherwise do not execute formC

I am new to access. I bet it should not be too hard. w/in formB, I tried putting this in a text box: =IIF([fieldB]="",[Forms!].[ReportC]), and I get "name error"

thanks

mike (idic5)
 
Two things. First, you were close but but no cigar. Instead of =IIF([fieldB]="",[Forms!].[ReportC]), you want =IIF([fieldB]="",[Forms]![ReportC]) Note the placement of the ! between [Forms] and [ReportC]. Secondly, depending on how you have the field set up, a zero-length string ("") may not be seen as a null value. You should try =IIF([fieldB]=Null,[Forms]![ReportC]) to be sure.
 

Users who are viewing this thread

Back
Top Bottom