I have a main form with a command button with a click event thus:
Code:
Private Sub cmdColors_Click()
DoCmd.OpenForm "frmColorChart", acNormal, , , , , Me.cmdColors.Left & ";" & Me.cmdColors.Top
End Sub
The intent is to communicate to the form "frmColorChart" where on the screen to display the form, right on top of the command button. The code in the Open event of the form "frmColorChart" is:
Code:
Private Sub Form_Open(Cancel As Integer)
Dim a() As Single
a = Split(OpenArgs, ";")
Me.Form.Left = a(0)
Me.Form.Top = a(1)
End Sub
Where my intent is to parse OpenArgs into its two parts and set the left and top positioning of the form. As coded, I get a "type mismatch" on the Split function in the Form_Open. I've tried Dim'ing the array as variant but still get the error.
Also, I tried to further experiment with setting Me.Form.Left with a literal value to see if I could effect positioning, but I get an error there as well having to do with Object legalities. With the latter experiment, it seems that the property Me.Form.Left might not be the correct expression to use?
Any thoughts on how to clear this up?
Thanks,
Bill