access forms events not working (1 Viewer)

mdelghandy

New member
Local time
Today, 14:09
Joined
Dec 7, 2023
Messages
7
I have a blank form in Access. Form events do not work when opening the form. For example, I wrote a code (msgbox) in the double click event, but it doesn't work. Meanwhile, macro access is also active.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 14:09
Joined
Jul 9, 2003
Messages
16,282
Might be an idea to post a bit more information.

What if you made a small MS Access App so that we can test it .....

I would have thought a message box would have worked, but it might depend on how you are calling it.

Extract from my website:-
Now you could be forgiven for expecting that a value passed into a form would be available for the form’s events to use. However it’s not!

See my website below for more information:-

 

bob fitz

AWF VIP
Local time
Today, 14:09
Joined
May 23, 2011
Messages
4,727
Is that the only event that isn't working?
Is the event property set to [Event Procedure]
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:09
Joined
Feb 19, 2013
Messages
16,614
crosspost
lots of questions asked and suggestions made here

 
Last edited:

mdelghandy

New member
Local time
Today, 14:09
Joined
Dec 7, 2023
Messages
7
Most form events do not work. For example, I want the user to get a message by double-clicking in the middle of the form. I write the code in the double-click event section of the form, but when I open the form, it does not react to the double-click event
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 09:09
Joined
May 21, 2018
Messages
8,529
If you create a Form event it will never fire in the middle of the form. Needs to be a section level event. Ensure it is a Detail level event.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:09
Joined
Feb 19, 2002
Messages
43,275
Most form events do not work. For example, I want the user to get a message by double-clicking in the middle of the form. I write the code in the double-click event section of the form, but when I open the form, it does not react to the double-click event
Not all form level events will fire if there are controls that have the focus. double-click is likely one of them.

If you want people to test your code, you need to post a database that includes the code that "doesn't work.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:09
Joined
Feb 19, 2013
Messages
16,614
See the op’s other thread (see link in post#4) for an image of the form- either the form has no controls or recordset is returning no records and is not allowing additions

I suspect the former
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 09:09
Joined
Feb 19, 2002
Messages
43,275
I responded to his other thread and pointed out that starting multiple threads on the same topic is unlikely to do anything except annoy experts for wasting their time.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 14:09
Joined
Feb 19, 2013
Messages
16,614
Given the lack of response from the OP other than to repeat the question, I suspect this is all going nowhere fast.
 

Gasman

Enthusiastic Amateur
Local time
Today, 14:09
Joined
Sep 21, 2011
Messages
14,306
Most form events do not work. For example, I want the user to get a message by double-clicking in the middle of the form. I write the code in the double-click event section of the form, but when I open the form, it does not react to the double-click event
Fo my DC event for the form to work, I had to DC on the record indicator?
1702123338137.png

Private Sub Form_DblClick(Cancel As Integer)
MsgBox "Double Click event"
End Sub
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 14:09
Joined
Sep 12, 2006
Messages
15,657
One problem. If you have a form with a non updateable query, and there are no records to display, you might find that lots of controls don't work as you expect.
 

Users who are viewing this thread

Top Bottom