auto open form when value chosen in cbo (1 Viewer)

Zydeceltico

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

I have a form where I record inspection data.

One of the bound controls is a combo box with several options in it. In most cases, the user would make a selection in the cbo and when the form is closed the chosen value will be stored in the underlying table.

There is one potential selection - that if chosen by the user - I would like for another form to immediately open - right then on AfterUpdate of the cbo - or when the cbo loses focus. The user would then fill out a couple of details to be stored in a different table, hit a Save button, and return the original form and complete the rest of the data input fields.

How can I tell the cbo that if the user chooses this specific option from your list of options then open the second form without closing the first form keeping the first form open so the user can return to it after filling out the second form?

Thanks,

Tim
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:04
Joined
Oct 29, 2018
Messages
21,358
Hi Tim. You could try the AfterUpdate event of the Combobox. However, if the second form needs to refer to the same record from the previous form, as part of a referential integrity constraint, then you may have to save the main record first before opening the second form, which I am not sure how it would affect your current process.
 

Zydeceltico

Registered User.
Local time
Today, 13:04
Joined
Dec 5, 2017
Messages
843
Hi Tim. You could try the AfterUpdate event of the Combobox. However, if the second form needs to refer to the same record from the previous form, as part of a referential integrity constraint, then you may have to save the main record first before opening the second form, which I am not sure how it would affect your current process.

Hi DB - yeah - exactly.

I think i'm going to have to create a table called InspectionDetails to house data like this. Then - pass Inspection_ID (from the first form) to the second optional form via OpenArgs which would then associate an Inspection_ID number with an InspectionDetail_ID. Haven't worked it out yet but that's what I'm thnking I'll need to do.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 10:04
Joined
Oct 29, 2018
Messages
21,358
Hi DB - yeah - exactly.

I think i'm going to have to create a table called InspectionDetails to house data like this. Then - pass Inspection_ID (from the first form) to the second optional form via OpenArgs which would then associate an Inspection_ID number with an InspectionDetail_ID. Haven't worked it out yet but that's what I'm thnking I'll need to do.
Give it a try and let us know if you get stuck. Good luck!
 

Micron

AWF VIP
Local time
Today, 13:04
Joined
Oct 20, 2018
Messages
3,476
You might want to open form2 as modal to ensure that a) user cannot do anything but complete it and b) stop code from completing in the calling procedure until form2 is closed.
 
Last edited:

Users who are viewing this thread

Top Bottom