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!

How can I make changes to forms/report via code?

Status
Not open for further replies.

dirkg

Technical User
May 20, 2000
170
BE
Hi all,<br><br>does anyone know how I can make changes to the design of a form/report via code without having to open the form/report (at least without making it visible to the user?)<br><br>Thank you very much in advance for your help.<br><br>Greetings,<br><br>Dirk<br><br><A HREF="mailto:dirk.news@yucom.be">dirk.news@yucom.be</A><br>
 
That depends very much on what kind of changes you want to make!<br>You can move objects, change their color etc.
 
Dirk, make your form load using the docmd make the visible property false.&nbsp;&nbsp;That way it's open but not visible remember that you need to make it visible in your other code.&nbsp;&nbsp;I use a Public Function called IsOpen when I need to write or check if the form is open here is the code I use.<br><br><br>Public Function IsOpen(ByVal strFormName As String) As Boolean<br>' Returns True if the specified form is open in Form view.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Const conDesignView = 0<br>&nbsp;&nbsp;&nbsp;&nbsp;Const conObjStateClosed = 0<br><br>&nbsp;IsOpen = False<br>&nbsp;If SysCmd(acSysCmdGetObjectState, acForm, strFormName) &lt;&gt; _<br>&nbsp;&nbsp;&nbsp;conObjStateClosed Then<br><br>&nbsp;&nbsp;If Forms(strFormName).CurrentView &lt;&gt; conDesignView Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IsOpen = True<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;End If<br>&nbsp;&nbsp;&nbsp;&nbsp;End If<br>End Function<br><br>I use it like this <br>If Isopen whatever then<br>code here.<br><br>Hope that helps.<br><br>Myron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top