What's wrong with this picture?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,
I am trying to get away with not creating a duplicate of my form. I would
like to use an "If" statement to determine which form is open, then change
the "Customer" (fSelectUtility) based on the selection in the combo box and
pass that back to the correct form (stDocName):

Dim stDocName As String
Dim stLinkCriteria As String

If Not "fCuts" Then
stDocName = "fCutsArchive"
Else
stDocName = "fCuts"
End If

stLinkCriteria = "tblUtilities.[KeyID]=" & Me![cboSelectUT].Column(0)

DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "fSelectUtility"

Thanks,
Nick
 
What is

If Not "fCuts" Then

supposed to be doing?

If you're trying to determine whether form fCuts is currently open, you can
use something like:

If CurrentProject.AllForms("fCuts").IsLoaded Then

or

If SysCmd(acSysCmdGetObjectState, acForm, "fCuts") <> 0 Then


If you're trying to do something else, post back with the details.
 
Thanks Douglas,
That is exactly what I needed. I open an unbound form with a combo that
select from, and then go back to that same form based on my selection. I use
with 2 different forms.

Thank you for your speedy answer,
NickX
 
Back
Top