IIf Help - Is Open? (1 Viewer)

systemx

Registered User.
Local time
Today, 20:16
Joined
Mar 28, 2006
Messages
107
Hi all,

I'm not sure if this can be done with the expression builder. I have a query that brings in a value from an open form when run. The query can be called from two seperate forms.

In my expression, I would like to check which form is open, and port the corresponding value.

In VBA -

If IsOpen(frmPSWork) Then
MyVar = Forms!frmPSWork!txtID
Else
MyVar = Forms!frmCSupdate!txtID
End If

In the expression I tried playing around with something simple along these lines without success -

IIf(IsEmpty([Forms]![frmPSWork]![txtID]),([Forms]![frmCSupdate]![txtID]),([Forms]![frmPSWork]![txtID]))

Please help!

Thanks

Rob
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 05:16
Joined
Aug 30, 2003
Messages
36,134
Search here for "IsLoaded".
 

systemx

Registered User.
Local time
Today, 20:16
Joined
Mar 28, 2006
Messages
107
Hi PBaldy,

Thanks for the help. :)

Rob
 

Users who are viewing this thread

Top Bottom