Fred Webb
asked on
Referencing a Control on a sub Form on a Navigation Form
I have a form frmVenAttendence that I added into a navigation form frmNavigation. the frmVenAttendence has a text box control named businessname which is used on a report to display the contents of that control on the report. The report control Source is =[Forms]![frm_VenAttendanc e]![busine ssname] which works fine outside the the navigation form. I know that when you put the form into a navigation form it actually becomes a subform of the navigation form and I need to reference both, but I am having a hard time getting the syntax correct. I have tried
=[Forms]![frmNavigation]![ frm_VenAtt endance].[ form].[bus inessname]
=[Forms]![frm_VenAttendanc e]![frmNav igation].[ form].[bus inessname]
neither work and am asked to enter the parameter value for that control.
=[Forms]![frmNavigation]![
=[Forms]![frm_VenAttendanc
neither work and am asked to enter the parameter value for that control.
The syntax you listed first is the correct one.
=[Forms]![frmNavigation]![ frm_VenAtt endance].[ form].[bus inessname]
However, this will only work if frm_VenAttendance is actually visible. If your navigation form is displaying another tab, you cannot reference [business name].
Ron
=[Forms]![frmNavigation]![
However, this will only work if frm_VenAttendance is actually visible. If your navigation form is displaying another tab, you cannot reference [business name].
Ron
ASKER
it is visible in the navigation form
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
however i now have other issues with this, I am beginning to think this was a bad idea.
I have some vba code that does filtering but now it errors as it doesn't know about the navigation form. This is my first foray into Navigation forms and may be my last. Really need some help with this.
the original code
I have some vba code that does filtering but now it errors as it doesn't know about the navigation form. This is my first foray into Navigation forms and may be my last. Really need some help with this.
the original code
'Filter frmCustomers based on search criteria
Forms!frm_VenAttendance.Filter = GCriteria
Forms!frm_VenAttendance.FilterOn = True
If Me.optWild.Value = 1 Then
Forms!frm_VenAttendance.Caption = "Vendors (" & Me.cboSearchField & " contains '*" & Me.txtSearchString & "*')"
Else
Forms!frm_VenAttendance.Caption = "Vendors (" & Me.cboSearchField & " equals '" & Me.txtSearchString & "')"
End If
What I tried to modify for navigation form 'Filter frmCustomers based on search criteria
[Forms]![NavigationSubform].[Form].frm_VenAttendance.Filter = GCriteria
[Forms]![NavigationSubform].[Form].frm_VenAttendance.FilterOn = True
If Me.optWild.Value = 1 Then
[Forms]![NavigationSubform].[Form].frm_VenAttendance.Caption = "Vendors (" & Me.cboSearchField & " contains '*" & Me.txtSearchString & "*')"
Else
[Forms]![NavigationSubform].[Form].frm_VenAttendance.Caption = "Vendors (" & Me.cboSearchField & " equals '" & Me.txtSearchString & "')"
End If
ASKER
Anyone?
Can you upload your database without any private data on it?
Ron
Ron
ASKER
Do to the time constraint I have decided to go a different way and not use the Navigation form, thanks anyway.
ASKER
Because that is what worked no other acceptable solution was provided.
ASKER