Form asking for parameter (1 Viewer)

Zydeceltico

Registered User.
Local time
Today, 18:42
Joined
Dec 5, 2017
Messages
843
Hi All -

I have a main form that has a bunch of command buttons on it that open various types of data entry forms for various types of process inspections.

The main form is bound to tblInspectionEvent.

All of the various inspection forms each have an underlying table that is linked to tblInspectionEvent on field InspectionEvent_PK.

I also have another table called tblInspectionEventNotes to have all inspection notes related to the inspection event rather than the satellite inspection (one of the various types of inspections). This table is also linked on InspectionEvent_PK.

When you open the db, you are presented with a single command button: "Inspections." Clicking that will open frmInspectionEvent.

On that form you will see there are several more command buttons on the lower left and a single one on the right. The buttons on the lower left open inspections realted to welding, mill operation, assembly, etc. The single one on the right opens a form for line stops.

All of the inspection forms have an embedded subform - sfrmInspectionEventNotes. Clicking any of the command buttons on the left for any of those inspection types - everything opens perfectly and data is recorded as expected in all fields.

When I click "Line Stop," I receive a request for a parameter for tblInspectionEvents.Notes.

The thing is I embedded the subform in frmLineStop exactly the same way (I think) as I did for all of the other inspection forms. I've checked all of the "On Load" events and they are identical - unless I am too close to this to recognize the flaw that surely exists.

Hoping for a fresh set of eyes.

-----UPDATE - - which comes first: "On Current" or "On Load?"

Thanks!

Tim
 

Attachments

  • Parameter Question.zip
    358.1 KB · Views: 102

Minty

AWF VIP
Local time
Today, 23:42
Joined
Jul 26, 2013
Messages
10,367
To Answer the which order question ;
https://support.microsoft.com/en-us...8787-ce86553682f9?ui=en-us&rs=en-us&ad=us#bm1
When you open a form, the Enter and GotFocus events occur after the events associated with opening the form (such as Open, Activate, and Current), as follows:

Open (form)
arrow
Activate (form)
arrow
Current (form)
arrow
Enter (control)
arrow
GotFocus (control)
 

Gasman

Enthusiastic Amateur
Local time
Today, 23:42
Joined
Sep 21, 2011
Messages
14,218
I do not think I can help. It says is need Access v14 to modify and when I click Inspections I get Module not found error?
I would say on load, but easy to check, just put a breakpoint in the form ?

Form events order
 

Minty

AWF VIP
Local time
Today, 23:42
Joined
Jul 26, 2013
Messages
10,367
You have this in the form record source
1586193797953.png
 

Zydeceltico

Registered User.
Local time
Today, 18:42
Joined
Dec 5, 2017
Messages
843
est for a parameter for tblIn
You have this in the form record source
View attachment 80616
I changed it to this (taken and changed form one of the other inspection forms that is working correctly) and I'm still getting the parameter request for some reason:
Code:
SELECT tblLineStop.*,
       tblinspectionevent.notes AS Notes_tblInspectionEvent
FROM   tblinspectionevent
       INNER JOIN tblLineStop
               ON tblinspectionevent.inspectionevent_pk =
                  tblLineStop.inspectionevent_fk;
 

Minty

AWF VIP
Local time
Today, 23:42
Joined
Jul 26, 2013
Messages
10,367
TblInspectionEvent doesn't have a notes field - so I'm puzzled why you think it has ??
 

Zydeceltico

Registered User.
Local time
Today, 18:42
Joined
Dec 5, 2017
Messages
843
TblInspectionEvent doesn't have a notes field - so I'm puzzled why you think it has ??

TblInspectionEvent doesn't have a notes field - so I'm puzzled why you think it has ??
Honestly - I don't know. As I recall - I used the subform wizard to place all of the subforms into existing inspections forms. And they all work perfectly - checking the InspectionEventNotes table shows that the data is getting recorded.

The above SQL: I opened frmInspectFab and copied it's SQL from the record source statement and simply changed tblInspectAssemble to tblLineStop thinking that since they all link back to tblInspectionEvent (and tblInspectioonEventNotes) that it should work - and it doesn't.
 

Minty

AWF VIP
Local time
Today, 23:42
Joined
Jul 26, 2013
Messages
10,367
Nope you would need add the table into your record source
Code:
SELECT tblLineStop.*, tblInspectionNotes.InspectionNotes
FROM (tblInspectionEvent INNER JOIN tblLineStop ON tblInspectionEvent.InspectionEvent_PK = tblLineStop.InspectionEvent_FK) INNER JOIN tblInspectionNotes ON tblInspectionEvent.InspectionEvent_PK = tblInspectionNotes.InspectionEvent_FK;
EDIT - And not being able to close the form if it errors is annoying!!!
 

Zydeceltico

Registered User.
Local time
Today, 18:42
Joined
Dec 5, 2017
Messages
843
Honestly - I don't know. As I recall - I used the subform wizard to place all of the subforms into existing inspections forms. And they all work perfectly - checking the InspectionEventNotes table shows that the data is getting recorded.

The above SQL: I opened frmInspectFab and copied it's SQL from the record source statement and simply changed tblInspectAssemble to tblLineStop thinking that since they all link back to tblInspectionEvent (and tblInspectioonEventNotes) that it should work - and it doesn't.
Nope you would need add the table into your record source
Code:
SELECT tblLineStop.*, tblInspectionNotes.InspectionNotes
FROM (tblInspectionEvent INNER JOIN tblLineStop ON tblInspectionEvent.InspectionEvent_PK = tblLineStop.InspectionEvent_FK) INNER JOIN tblInspectionNotes ON tblInspectionEvent.InspectionEvent_PK = tblInspectionNotes.InspectionEvent_FK;
EDIT - And not being able to close the form if it errors is annoying!!!
I'll try the SQL - AND YEAH - the not being able to close it is REALLY annoying - I forgot about code I have tied back to an Enabled/Disabled button on the main menu that I removed in order to make the uploaded db "easier" to navigate and clearly that was a mistake.
 

jdraw

Super Moderator
Staff member
Local time
Today, 18:42
Joined
Jan 23, 2006
Messages
15,379
I was trying to identify some issues including the lack of Notes in TblInspectionEvent, and there is ctl undefined-- but I was trying to work thru the linestop and got into a circular issue where I couldn't exit the form and couldn't get out of vba --- application error??? I had to use task manager to stop Access??
As suggested previously, I think you have to draw a simple chart/process flow so we're all on the same page when posting/responding.
 

Users who are viewing this thread

Top Bottom