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

Changing PopUp property in code Syntax error? 2

Status
Not open for further replies.

bhoran

MIS
Nov 10, 2003
272
US
I am using popup forms in a database however, when i want to display a report it opens beneath the poup form.

I can close and re-open the form but I then lose the selection on multiselect listboxes.

So I thought if I can change the popUp setting to = false before the print preview it woud solve it.

Unfortunately I have not been able to get the syntax right (unless there is a deeper issue like you can't change it whilst its in focus or something) I have tried: Me.Form.PopUp
frmFrormname.PopUp
Me.PopUp

all with no success.

Any help is appreciated.
 
Hi,

Possible work around...

In the open and close events of the report make the form hidden / visible.

eg.

Private Sub Report_Close()
Forms!frmFormName.Visible = True
End Sub

Private Sub Report_Open(Cancel As Integer)
Forms!frmFormName.Visible = False
End Sub



There are two ways to write error-free programs; only the third one works.
 
GHolden that does exactly what I am after but I am having trouble passing the form name as a variable.

I have several users accessing the reports from different screens (due to security) so I use a variable to define the screen the user is in.

The variable is called ibmFormLaunch and gives the name of the form without any other characters e.g. Main_MKTG

I have tried:
Forms!ibmFormLaunch.visible = true

Forms! & ibmFormLaunch.Visible = true

Dim strFormName as String
strFormName = "Forms!" & ibmFormLaunch
strFormname.visible = true

Dim strFormName as String
strFormName = ibmFormLaunch
Forms!strFormname.visible = true

But with no luck, wherever I use Forms! and the variable it looks for a form with the name of the variable.

Where I tried to build the full string "Forms!" & variable I get an error Invalid Qualifier.

Any ideas?

Thanks
 
Hi!

Just use a different syntax.

[tt]Forms("FormName")[/tt] - "equals" Forms!FormName
[tt]Forms(FormVariableName)[/tt] - use of variables

To also include controls with variable names:

[tt]Forms("FormName")("ControlName")[/tt]
[tt]Forms(FormVariableName)(ControlVariableName)[/tt]

Roy-Vidar
 
Perfect!!!

Thanks a lot for your help Roy-Vidar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top