I've got a form whose Form_Load event isn't running. The Form_Open event runs fine as do the button's on the form. I have removed the link in the properties window and recreated the event as was suggested by all the online forums. I have a breakpoint setup on the first line of executable code and it doesn't do anything. I don't know what else to try.
9 3136 NeoPa 32,556
Expert Mod 16PB
What does the value in the Property window say for Load?
Copy/Paste = [Event Procedure]. I wiped that out, and clicked on the ellipsis, selected Code Builder and it went directly to my code.
I'm opening it as a Dialog window and I have it's Modal and Pop Up properties set to Yes. There are no subforms involved. I don't think that these setting make any difference on what events fire as I have used these properties before and never had any trouble, but I thought that I would mention it.
If you are sure that it should be running, but it isn't you might be getting into a bit of corruption.
A few things to try: - Copy your Form, Recompile and Save. Then test with your Copied Form.
- Blow away all the code for the Form_Load (Copy to a text file first). Compile and Save, then re-open, and attempt to add it again by clicking the Event Ellipse on the Property Window.
- Create a new Form and paste your startup code into the Form_Load and see if it gets Executed. If so, copy the controls and the rest of the code over, Copy over the properties on your Form, re-setup all the Events for your controls by clicking on the Event Ellipse on the controls Property then selecting Code Builder. .. I know this doesn't sound like fun, but it might get you past your problem.
- If all else fails, create a new Database and Import all the objects.
Visual Studio/Winforms likes to do this every so often and the easiest way to fix it is to edit the Form Source, but that's really not an option here.
Numbers 1 and 2 didn't work, but number 3 seems to be working. Now to start copying over 160 lines of code...
I had just created the event too. It never did work. I'm starting to get several corrupted forms now. Very frustrating.
Make backup copies as soon as possible. You may need to resort to importing into a new database soon. =(
If I remove the link to the Form_Open event, everything works fine. If I reconnect the link to the Form_Open event, the Form_Load event doesn't fire. I have verified this on both the old and the new (from scratch) forms.
Here is what I have in the Form_Open event: - Dim strSQL As String
-
-
strSQL = "SELECT CS.CustID_fk, S.Service, CS.Used " & _
-
"FROM Options_Services AS S INNER JOIN Customer_CustomerServices AS CS " & _
-
"ON S.ServiceID_pk = CS.ServiceID_fk " & _
-
"WHERE CustID_fk = " & g_CustomerID
-
-
Set db = CurrentDb
-
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
-
Set Me.Recordset = rst
-
-
Me.Service.ControlSource = "Service"
-
Me.Used.ControlSource = "Used"
Both the db and rst variables are declared as module level variables. Does this help it make sense that the Form_Load event isn't firing?
This seems fun.
Instead of this: - Dim strSQL As String
-
-
strSQL = "SELECT CS.CustID_fk, S.Service, CS.Used " & _
-
"FROM Options_Services AS S INNER JOIN Customer_CustomerServices AS CS " & _
-
"ON S.ServiceID_pk = CS.ServiceID_fk " & _
-
"WHERE CustID_fk = " & g_CustomerID
-
-
Set db = CurrentDb
-
Set rst = db.OpenRecordset(strSQL, dbOpenDynaset, dbSeeChanges)
-
Set Me.Recordset = rst
-
Maybe try: - Dim strSQL As String
-
-
strSQL = "SELECT CS.CustID_fk, S.Service, CS.Used " & _
-
"FROM Options_Services AS S INNER JOIN Customer_CustomerServices AS CS " & _
-
"ON S.ServiceID_pk = CS.ServiceID_fk " & _
-
"WHERE CustID_fk = " & g_CustomerID
-
-
Me.RecordSource = strSQL
Also, what is happening in Form_Open? I doubt there would be something to actually stop Form_Load, but it's possible.
I'm using transaction commit/rollback, so I think that I need to have it be Recordset and not RecordSource. However, I'm no expert on this type of solution, so I may be wrong. I could test it though to see if setting the form's recordset in the Form_Open event is stopping the Form_Load event from running. To me, that would make no sense, but that doesn't mean anything.
Bingo. If I comment out line 10 in post #7, then the Form_Load event runs. If I uncomment it, Form_Load doesn't run. Now to test the transaction Commit/Rollback functionality without using Recordset.
Has anyone else noticed this? I checked Allen Browne's list of bugs, but didn't see it listed.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Steve M |
last post by:
Why are my sessions lasting so long?
I have them set to 20 minute timeout in config file?
The Session_End event is getting called an hour or more sometimes--well
after the user has stopped...
|
by: MS Newsgroups |
last post by:
Hi,
I have a scenario where I am dynamically adding a control from code when a
controls event is fired. The problem I have is that when the newly created
control is clicked, the click event does...
|
by: Shane Bishop |
last post by:
I've been fighting with the Page_Load event firing twice.
I looked through this user group and saw several other people having
similar problems.
There were various reasons for it:...
|
by: Paul |
last post by:
Hi,
In a class i built, i fire an event when a field changes. In a webform that
has an instance of the class, the event (from the class) is fired and the
code is executed. However, my webpage...
|
by: Larry Morris |
last post by:
The following code, pasted into a web form with a link button on it, will
cause the page_unload event to fire twice. If I remove the
response.redirect, the problem goes away :). I've got a work...
|
by: Seraph |
last post by:
Again, I'm rather new here, so if I fail to follow any etiquette,
please forgive me and let me know what I've done wrong, but I think
this might interest quite a few people.
One of my colleaques...
|
by: Dan |
last post by:
I have an aspx page with a form on it. There are a couple of textboxes and
an ImageButton. The page is loaded from another page using Server.Transfer.
When I click on the ImageButton, the...
|
by: crk2 |
last post by:
Here a simple one. (At least I think it is?) and any help would be truly
appreciated.
I have an inherited textbox on my form based on a custom texbox control. It
looks something like this ...
|
by: hazz |
last post by:
I would like to have control over datagridview events so that when a user
'single clicks' anywhere on the grid, a method call is made to a service and
if a user 'double clicks' a Customer detail...
|
by: tommaso.gastaldi |
last post by:
Hello,
A probably dumb question...
does anyone know hot to avoid that if one keep the mouse pressed on an
arrow of the numericUpDown it continues to fire events (it uses
evidently a timer) ?...
|
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...
|
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...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |