473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

=function() On Click Event refusing to work - on a subform...

Knut Ole
i get the following error:
Expand|Select|Wrap|Line Numbers
  1. "The expression On Mouse Move you entered as the event property setting produced the following error: A problem occurred while Access was communicating with the OLE server or ActiveX control."
the .OnMouseMove event for the control is set from a module, like thus:
Expand|Select|Wrap|Line Numbers
  1.  
  2.              .OnMouseMove = "=rDraw(false," & cImg1.Name & "," & cImg3.Name & ")"
  3.  
(this is working, ie. the control has this line of OnMouseEvent.)

the function i'm trying to call is declared thus and located in a module:
Expand|Select|Wrap|Line Numbers
  1.  
  2. Public Function rDraw(fEdge As Boolean, varEdge As String, varBody As String)
  3. Dim fX As Long
  4. Dim coord As POINTAPI
  5. Dim cmdLeft As Long
  6. Dim cmdWidth As Long
  7.  
  8. (...)
  9.  
  10. End Function
  11.  
for some reason, however, it's as if the OnMouseMove event can't find the function?! does anyone have experience with this kind of problem? is my syntax wrong? (i dont believe it is, as i've had it work once already manually. not able to replicate that anymore however.) or should i declare the function differently, or put it in a different module? (they should be accessible from anywhere, tho right?)

thanks a lot!
May 5 '11 #1
3 2174
dsatino
393 256MB
Yes and no. If it's within a module you created then yes. if it's with a form module then:
Yes for any other code within that form module.
Yes for code outside the form module that references the form.
No for code outside the form module that doesn't reference the form.
May 5 '11 #2
Stewart Ross
2,545 Expert Mod 2GB
When using string literals as arguments to the function you must enclose the literals in double quotes, otherwise the value passed will be misinterpreted at run-time as some kind of reference to an unknown entity. To use a double-quote within the string built in your code module you repeat the double-quote symbol three times, like this:

Expand|Select|Wrap|Line Numbers
  1. .OnMouseMove = "=rDraw(false,""" & cImg1.Name & """,""" & cImg3.Name & """)"
-Stewart
May 5 '11 #3
thanks!
fixed the syntax, thanks! but it was actually a problem of a function i redeclared, upon which the old declaration (different name) "got stuck" in the formmodule, and it got messed up. brought out a fresh formmodule and everything worked fine. reproducable bug.
thanks again!
May 5 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: cwm137 | last post by:
I am trying to call the click event of a button located in a subform called "Order Subform" from a button in the parent. However, since the subform was made with the wizard, it contains a space in...
2
by: Uninvisible | last post by:
I have put together a db for a law firm to keep track of counterfeit activities. There are four parent tables: tblContact tblTransaction tblAction tblFile I have created a form,...
2
by: Kjell Kristiansson | last post by:
I have not been able to figure out how to catch the click event from a button that is added dynamically to a table. In priciple the process is as follows: When I first create the page I analyse...
17
by: Eric | last post by:
I'm new to JavaScript and I wrote this code to play with. Oddly, if I enter text in a box and then press the button, I only get the onChange event for the text box and not the button's onclick...
4
by: LyzH | last post by:
Someone else had a question on how to emulate a mouse click. I tried posting in that thread but I have something of a twist on this problem and I'm really in trouble here! If I don't get help...
4
by: Savita23 | last post by:
Hi, I have a subform in datasheet layout embedded in the main form.I want to invoke a procedure on the double click of each record in the subform.Is there a away by which I can fire the double...
6
by: Jim Devenish | last post by:
I have an unbound form that displays all the days of the year as a calendar. It has 12 rows of text boxes with either 29,30 or 31 in each row. Text box names are of the form: display_01_01,...
2
stonward
by: stonward | last post by:
I'm trying to change the recordsource of a subform using a simple button click: by default, the subform's source is one query, when a button is clicked it changes to another query (the same query,...
15
by: Martin Lang | last post by:
Hi All, Thanks for reading this :) I have a form A that consists of a main form A and a sub form A. In sub form A, I have a field which I can double click. Then, Main form B opens up with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.