Solved Navigation SubForm opens another Form (1 Viewer)

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
I have a Navigation Form in which the first button is defaulted to show a blank form (Request form) where users will enter information.

There's an option on this Request form that if there are multiple requests under this request, `a box is checked and another form opens (Multiple Requests).

The request number from the Request form is defaulted into the multiple request form's request number field.

On the Multiple Request window's ID field in Property Sheet/Data/Default Value I have =[Forms]![frmRequests]![RequestID]

With the Request form open on its own, this works great, but within the Navigation form it doesn't.

Is there another layer that I need to add so the default value works in either format? I will be using it in the Navigation form primarily.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
Yes. When you use a Navigation Form, your original form is placed in a subform container in the Nav Form. So, you will have to add that layer into your syntax. For example:

=Forms!NavigationFormName.NavigationSubformName.Form!RequestID
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
Yes. When you use a Navigation Form, your original form is placed in a subform container in the Nav Form. So, you will have to add that layer into your syntax. For example:

=Forms!NavigationFormName.NavigationSubformName.Form!RequestID
That worked great! Thank you
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
What if it's a form within a form that pops up another form?

So I have to have the requestors go back and finish a request if they need to. The second button on the Navigation Form has a form with a dropdown so they select the request to finish. This will make an Incomplete Request form visible to the record that was selected. (all works ok up to here)

So that makes three forms:
Navigation Form (Focusing on Second option in this menu)
Finish Request (this is a form with a combo box to select the record - makes the form (IncRequests) visible with the record open)
IncRequests Form - the form to complete the record - this form has an option for a click that opens another form for the multiples, same previous concept but there's another layer.

This is what I put on the Multiple Requests form's Default Value
=[Forms]![NavigationForm].[FinishReq]![frmIncRequestQ].[Form]![txtProjectNumber]

I've tried a few variations with the ! and . - can you help?
 

Attachments

  • Doc1.pdf
    147.7 KB · Views: 199

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
=[Forms]![NavigationForm].[FinishReq]![frmIncRequestQ].[Form]![txtProjectNumber]
That syntax looks a little off.

Is [FinishReq] a subform control? If not, is [frmIncRequestQ] a subform control?
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
The first Subform is FinishReq and frmIncRequestQ is embedded in that one
frmIncRequestsQ open the Multiple Requests
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
The first Subform is FinishReq and frmIncRequestQ is embedded in that one
frmIncRequestsQ open the Multiple Requests
Then maybe try it this way.
Code:
=[Forms]![NavigationForm].[FinishReq].Form![frmIncRequestQ].[Form]![txtProjectNumber]
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
It is still giving me #Name? error. :(
A #Name? error usually indicates a typo because Access couldn't resolve a name for an object. Double check the spelling and make sure you're using the correct names. If you need help doing that, consider posting a sample copy of the db.
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
Hopefully by seeing what I'm trying to do will make it clearer to understand. Thank you for taking the time! You have to click on "Does the Project require Multiple requests" checkbox
 

Attachments

  • Estimate Requests Database.zip
    684.7 KB · Views: 203

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
Hopefully by seeing what I'm trying to do will make it clearer to understand. Thank you for taking the time! You have to click on "Does the Project require Multiple requests" checkbox
Thanks. See if this helps...
 

Attachments

  • Estimate Requests Database.zip
    442 KB · Views: 227

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
The first form worked great, but the second tab is still having an issue populating the number (frmIncMultipleRequests). I tried adding the second layer following your concept but still got the Name error

=[Forms]![NavigationForm].[NavigationSubform].[Form]![FinishReq].[NavigationSubform].[Form]![txtProjectNumber]
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
The first form worked great, but the second tab is still having an issue populating the number (frmIncMultipleRequests). I tried adding the second layer following your concept but still got the Name error

=[Forms]![NavigationForm].[NavigationSubform].[Form]![FinishReq].[NavigationSubform].[Form]![txtProjectNumber]
Sorry, I just followed your instruction. I clicked on the checkbox, and a form popped up. I saw the two #Name? errors and just fixed those. I didn't check anywhere else. I'll take another look when I get in the office.

Sent from phone...
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
NO Problem! I appreciate that you're taking the time!
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
On the NavigationForm pop up it's the " Finish an Incomplete Request "
 

theDBguy

I’m here to help
Staff member
Local time
Today, 01:48
Joined
Oct 29, 2018
Messages
21,357
On the NavigationForm pop up it's the " Finish an Incomplete Request "
Hi. Unfortunately, your file won't open here at work, because we have an older version of Access. So, I might have to wait until I get home tonight to look any further into this. Sorry.
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
That's ok, thank you. I look forward to seeing what you come up with.
 

VzqCrs

Member
Local time
Today, 04:48
Joined
Nov 15, 2021
Messages
54
what's the best way to update Default Value when txtProjectNumber is a text field? Currently if I enter a non-numeric value I will get the error in the field
 

Users who are viewing this thread

Top Bottom