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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Events Firing Twice

Status
Not open for further replies.

sarahnice

Technical User
Nov 18, 2002
101
0
0
IE
Hi all,

I posted this same problem before but got no response. I was hoping someone could help me this time cause it's still causing a problem with my forms.

I have a form with numerous controls that do different things. When i click on the control it seems to fire the event twice. I have commented out everything in the function that is being called so that only a Msgbox command is left. It still fires twice.

I am sure that the function s not calling itself and that there are no other functions calling it. Is this an Access problem and is there any solution.

Thanks
 
You may need to post more information to get a reasoned response.What event does the control fire?.Is the form bound or unbound.There may well be a lot of scenarios
 
The control on the form is a label with an onMouseEvent. The label, when clicked, opens a second form in design view, adds some elements to it (labels, text fields, etc), then saves and closes the form in design view. The function then opens the form in normal view.

When i click on the label, the form can be seen opened in design view. I can see the elements being added and then the form closes. The form then opens again in design view, I can see the elements being added again. After this, the form opens in normal view.
 
Have you tried putting a break point in your code and stepping through it line by line? Does the On Click event fire twice even when only calling a MsgBox?

Ken S.
 
I know i should have updated this sooner but i found a solution.

I am calling a sub that takes a parameter and the event runs twice. If i remove the parameter, the event runs three times.
I fi change the sub to a function (just i the decalration, nothing else), then the event only runs once as required.

I don't know why this happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top