Glenn-
Check for IsMissing and substitute the current values if true.
Dim lngTop As Long, lngWidth As Long, lngHeight As Long
If IsMissing(Top) Then
lngTop = oMyForm.Form.WindowTop
Else
lngTop = Top
End If
… etc.
oMyForm.Move Left, lngTop, lngWidth, lngHeight
John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)
On Mar 7, 2014, at 4:17 PM, Glenn Lloyd <argeedblu@gmail.com> wrote:
> I am trying to write a wrapper that calls a form's move method. That method
> takes one required and three optional arguments:
>
>
>
> Move(Left, Optional Top, Optional Width, Optional Height)
>
>
>
> This is in the context of a class that has a form as one of its members.
>
>
>
> Let's say I have instantiated an object of this class as oMyForm. Right now
> I can move the form this way
>
>
>
> oMyForm.Form.move xxx, [yyy], [www],[ hhh]
>
>
>
> I am writing the wrapper so that the call will look like this
>
>
>
> oMyForm.move xxx, [yyy], [www],[ hhh]
>
>
>
> This is what I have so far in the class. Mfrm is th internal private form
> variable
>
>
>
> Public Sub Move(Left As Long, Optional Top As Variant, Optional Width As
> Variant, Optional Height As Variant)
>
> ' Procedure: move
>
> ' DateTime: 3/7/2014 9:51:46 AM
>
> ' Author: Glenn Lloyd
>
> ' Description: call the form's move method to position it
>
> '--
>
>
>
> Const cstrProcedure = "move"
>
> On Error GoTo HandleError
>
>
>
> 100 mfrm.Move Left
>
> 'what if the call includes one or more of the optional arguments
>
> HandleExit:
>
>
>
> Exit Sub
>
>
>
> HandleError:
>
> ErrorHandle Err, Erl(), cstrModule & "." & cstrProcedure
>
> Resume HandleExit
>
> End Sub
>
>
>
> I am stuck at the line that I have labeled 100. How do I respond to the
> various possible combinations of the optional arguments?
>
>
>
>
>
> Glenn Lloyd
>
> Sudbury Training
>
> (705)805-6712 | Fax (705)805-805-0696| Text (705)885-5283
>
> www.SudburyTraining.com <http://www.sudburytraining.com/>
>
>
>
> LogoHoriz
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>
>
------------------------------------
Yahoo Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MS_Access_Professionals/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/MS_Access_Professionals/join
(Yahoo! ID required)
<*> To change settings via email:
MS_Access_Professionals-digest@yahoogroups.com
MS_Access_Professionals-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
MS_Access_Professionals-unsubscribe@yahoogroups.com
<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/
Tidak ada komentar:
Posting Komentar