PDA

View Full Version : So simple I cannot see it!



vbred
06-04-2011, 02:19 PM
Hello!

I have been working on a series of codes for several hours and I am going cross eyed. Below is my procedure and I keep getting an error. Any help would be greatly appreciated. I am sure it is right in front of me but I do not see it

Private Sub cmdNew_Contact_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
X = DoCmd.OpenForm("Home", acNormal, , Forms.EmployeeList.cmdNewEmployee.OnMouseMove)
End Sub

hansup
06-05-2011, 06:14 AM
First, please consider "I keep getting an error" is not very useful. You can make it easier for others to help you by describing the error message. For example, "I get error #11, 'Divide by zero', from

Debug.Print x / y

DoCmd.OpenForm doesn't return a value, so I think you will get a compiler error from trying to assign it to your variable X. This could work:

DoCmd.OpenForm "Home", acNormal

I left off Forms.EmployeeList.cmdNewEmployee.OnMouseMove because I don't understand why you want to use a control's OnMouseMove property as the WhereCondition to OpenForm, or if that can even work.

This is the syntax for OpenForm:

expression.OpenForm(FormName, View, FilterName, WhereCondition, DataMode, WindowMode, OpenArgs)