Link to home
Start Free TrialLog in
Avatar of ronallard
ronallard

asked on

Need help with syntax ....

Here's some sample code:
 stLinkCriteria = "[ClientNo]=" & "'" & Me![Combo0] & "'"
 Where2Go = "frmSampleForm"
 DoCmd.OpenForm Where2Go, , , stLinkCriteria

Too this I would like to add WindowMode of either acWindowNormal or acHidden. I can't, for the life of me, figure out how to add the comma and WindowMode to the stLinkCriteria variable's definition.
Avatar of Dedushka
Dedushka

Just use:
DoCmd.OpenForm Where2Go,acNormal , , stLinkCriteria

This is more correct:
DoCmd.OpenForm Where2Go, acNormal, , stLinkCriteria


Avatar of ronallard

ASKER

You must have missed the drift of my request. WindowMode is the last option in the string to be passed. Sometimes I want to open this form Hidden. I'm looking for a way to adjust this with the setting of a variable. I thought I would just tack in onto the stLinkCriteria variable but can't figure out the syntax to get it resolved properlyl.
ronallard,
you can't include mode unto stLinkCriteria, you should use a separate variable for Window Mode:

Dim intWindowMode As Integer
Dim boolHidden As Boolean

'...
' somewhere boolHidden = True/False, let it be False
boolHidden = False
'...

If boolHidden = True Then
    intWindowMode = acHidden
Else
    intWindowMode = acWindowNormal
End If

DoCmd.OpenForm Where2Go, , , stLinkCriteris, , intWindowMode

Try this and let me know,
Dedushka

This works great!  Thanks so much. could you post as an answer so I can close this?
ASKER CERTIFIED SOLUTION
Avatar of Dedushka
Dedushka

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks so much for the help!