General :: Referring To Subform In Navigation Form
Mar 5, 2013
I have an Access 2010 application and I'm having trouble referring to properties in my subform withon a Navigation form. Based on a selection in a Combo Box, I need to change the filter on the subform. The relevant forms are:
Main Navigation Form = frmAdminNav
"Standard" Navigation Subform = NavigationSubForm
My Subform = frmShowInventory
How do I refer to the Filter property on frmShowInventory?
I believe I did this before awhile ago but for some reason I keep getting an error.
I have a Mainform (frmMain) that has a Subform (frmSub). On frmSub I have 2 comboxes (strCom1 & strCom2) one is set to invisible (strCom2.Visible = No).
So using the "On Open Event" of frmMain I want make strCom2 visible if strCom1 = "Read Only". Ofcourse I will also need to place the vba on the On After Update event. Below is what I have so far but doesnt work.
I get Run-time Error 2427 "You enetered an experssion that has no value"
Code:
Private Sub Form_Open(Cancel As Integer) If Me!frmSub.Form!strCom1.Value = "Read Only" Then Me!frmSub.Form!strCom2.Visible = True Else Me!frmSub.Form!strCom2.Visible = False End If End Sub
I have a form named frmMain that contains five buttons that lead to subforms, one of which is named frmDeceased.
In frmDeceased, I needed to create a combo box that relied on selections from the combo box before it. I was able to do this successfully in frmDeceased, but then today when I opened the database and opened frmMain, I realized that the query fails when frmDeceased is opened via frmMain. It works perfectly if I just open frmDeceased directly.
The first combo box is ROHE and the second is Iwi (which is dependent on the Rohe selected).
The query for Iwi has this criteria: Forms!frmDeceased!cbo_ROHE
When I open frmDeceased through frmMain, I get the 'enter parameter value' message showing "Forms!frmDeceased!cbo_ROHE".
I tried changing this query to: Forms!frmMain!frmDeceased!cbo_ROHE, but it didn't work.
The [ItemsID] is actually on the form as a txt box. but i dont really need it there for any other purpose other than the vba above.
In the form i have a field that is in the form as a txt box that has a relationship to the ItemsID. i have attached a image of the relationship.
The field that is in the form is tblOrdersItems.OrdersItemsID and i also have tblItems.Items. so rather than adding another meaningless txt box to the form(ItemsID) i would like to be able to use the relationships to get the correct ItemID ...
I have a form with a subform which resides in a tabbed control. In that subform, I have a textbox in the footer that sums values in the detail section of the subform.
I have a textbox on my main form that should display the same data that is in my subform footer textbox, but it is giving me the #name? error.
This is the expression in my subform footer textbox (which returns the correct result):
TxtSubtotalHQPCalc - =Sum([ActualHQPCalc])
And the expression in my main form textbox (which returns #name?):
I have verified that my subform name and textbox names are all accurate. This is very frustrating because I am using this exact same method in a different database with no problems!
Go to frmInvoice, and you'll see a Net Total box (txtNetTotal) . It's control source is linked to a textbox in the subform fsubInvoiceDetails2 called txtStocktotal. It basically just pulls up all the costs associated with that InvoiceID.
The reference mechanism is as follows: =[fsubInvoiceDetails2].[Form]![txtStockTotal].Now...sometimes this works and sometimes it doesn't! Sometimes i've had to use: =forms!fsubInvoiceDetails2!txtStockTotal.
It seems to be very temperamental at times and i'm not fully confident if this can be explained.By way of note, I use express builder normally to input these statements: I go to Forms > ALL FORMS > fsubInvoiceDetails2 > txtstocktotal.
Any way to list all currently opened Access databases? It feels like this must be possible by referring to the databases collection, but I just don't know how.
Also, is it possible to refer to controls on a form in one open database from code in another database? (and obviously if so, how?)
I have a Navigation form that has multiple forms that I linked to buttons at the top. They open the forms (now subforms) for the most part just fine. The issues come into play when I click on a combobox that pulls from a query of a table. Once this data is selected I have another combo box that is supposed to be filtered based off of the original combo box selection. Everything works on the original forms but once they are in subform form I get the error "Forms!MGM Search Form!STATE" which is the name of one of the forms and its asking for me to enter a parameter value for the query. Its almost like its not requerrying the data like it does in the original form
Private Sub State_AfterUpdate() me.Facility.Requery End Sub
basically the first combo box is a list of states and then the second combo box is a list of facilities in that state. Once you click on the state in the first combo box it filters the facilities in that state. But again once in the subform view it will not requery.
Just a quick question, I can't seem to get this right (as usual :confused: )
I have a form and I want the label in the header to display the text from a field in a related subform. I have tried the following syntax to no avail: =[Forms]![sfrmCompanyName]![LastName]
I know how to refer to a control on a form by using [forms]![formname]![controlname], but can anyone help with referring to a subform.
I have a subform called subPrograms, on which is a combo box whose contents need to be filtered depending on the selection from another combo box on the main form.
The combo box on the main form is cboDivisions. The combo box on the subform is cboPurchasers Main form is called frmMain Subform is called subPrograms
The user is supposed to select a Division, and then depending on that selection the contents of cboPurchasers will change to only show those that are within that same division.
I would also like to know how to update the cboPurchasers when the cboDivision has been selected? Can someon help?
I'm working on the Navigation Form template in Access 2010, which is new to me. It appears that one needs to use the BrowseTo command to open up a form in the built-in subform module. I'm trying to create a couple of buttons where each button opens a form in a different data mode; one in read-only and one in add mode. Here is the syntax I used for read-only:
frmSales is the Sales form I want both of the buttons to open and frmNavigation is the Navigation form. It seems to be ignoring the data mode part at the end however. It only will open in Edit mode. Is there something I'm doing wrong with this command?
I have created a master form, which is a tab style. I have five additional forms that I want to use as sub-forms within each tab. I also want to include master navigation buttons that will work for each sub-form in unison. In other words if I navigate to record 10 on tab 1 and switch to tab 2, I want the new tab to show the information related to record 10. It would appear that I need to link them together in some fashion.
I have a navigation form which has two subforms on it (ie 2 tabs linking to different forms). I have got aq filter working for one of the forms but not on the other. This is using
If IsNull(Me.txtoperationscontract) Then MsgBox "Please type a contract number into the textbox!", vbInformation + vbOKOnly, "Incorrect Details" Else Me.OperationsSubform.Form.Filter = "[Contract]='" & Me.txtoperationscontract.Value & "' " Me.OperationsSubform.Form.FilterOn = True End If
The problem is that it does not work on subform B because the Contract field does not exist.
I have a navigation form, a navigation subform, and then a subform. When I click the save button on the navigation subform, i need the data entered in two fields on the subform to save in a table. the subform is based on a query. This is what I currently have on the the button's onClick event:
Code: Update data_tbl Set [data_tbl].[Approved] = [Forms]![Navigationfrm]![Navigation subform].Form![Entry_subfrm].[Form]![CboAppd] [data_tbl].[Comments] = [Forms]![Navigationfrm]![Navigation subform].Form![Entry_subfrm].[Form]![txtComments] WHERE [data_tbl].[ID] = [Forms]![Navigationfrm]![Navigation subform].Form![Entry_subfrm].[Form]![ID]
I want my subform to allow additions. I would like the default value for one of the fields in the subform to be the value chosen in the combo box that is used to select which records are shown in the subform. The row source for the combo box is
SELECT tblLicensee.LicenseeID, tblLicensee.[Licens#] FROM tblLicensee; where LicenseeID is the key field and Licens# is what is displayed.
If I refer to the combo box for the default value for that control on the form… =[Forms]![frmFindRecord]![Combo37]
the key value (LicenseeID) is entered as the default instead of the value displayed in the combo box (Licens#). How can I set the default value to record the Licens# instead?
I have a form with a subform that has a table on it. The subform table is a price list with the fields Description, Details (which is hidden as it's too big for the table) and Price.
I want to be able to double-click on a chosen item from the table to display a pop-up showing the same details but with the Details field shown. I have the pop-up in place but I am struggling with displaying the chosen information.
How do I reference the fields on the chosen line in the table?
have set up a navigation form which contains 5 unbound subforms that are made visible or not visible thru the on click event of command buttons on the main form, the subforms have a command button with an embedded macro that searches for a record based on what has been keyed to an unbound text box on the subform, this works fine when the sub forms are opened independently of the navigation form but when the search is done from within the main form, the error message is, "....cannot find the referenced from frmAQIFAList" subform, I tried referencing the main form name infront of the subform name but this also doesn't work, perhaps this would be better with code ? or is it because the subforms are unbound ?
There is a command button on my form that calls a filtered query. I'm filtering the query based on a combo box within the form using
[Forms]![frmAssignDwgs]![Combo15]
It works beautifully until I put the form as a subform in the Navigation Form I'm using. When I execute it from within the Navigation form, it errors out looking for [Forms]![frmAssignDwgs]![Combo15].
Is there another syntax I can use so this will still work from within the Navigation Form? Or another way to approach this functionality?
frmNavigation is the main navigation form frmAssignDwgToPkgs is the subform that holds Combo15
I found another thread (which I can't link to since I'm new) and tried various arrangements of the following to no avail.
how do I get access to the default navigation buttons on a form ie back, forward, new and last buttons. I want to right some VB code that acts when the buttons are pressed. How do I do it?I don't really want to create my own buttons and do onclick events.
I have a form which contains fields from my main table and also has a subform containing a query based on a filtered list of my main table.
I have a combobox on the form to select a name and pass it to the query to filter on.
The list of names is in a table called tblnames which has 2 fields, name and ID. I have linked the ID field on this table to a field called nameid on my main table which is a numeric field (and that allows be to select a name from a list when I enter data into my main table.
The xox is unbound, control source empty and row source set to tblname.
The combobox is only showing a list of numbers (I assume they are the id field from tblname). Yesterday I had the list of names showing and I checked a backup and the only difference I can see is the row source property refers to the name field in tblname but I don't know how I got it there. When I click on the list box for row source I only get offered a list of my objects.
i have built an application , all i have is one main form and every action take place inside it. Before making it as .accde file for code protection, i want to hide table pane, navigation ribbon, the Main form Tab. i.e only Main form should open like a applicaiton and not inside access as a tab.
I am not able to disable NavigationButton when i login navigation form using login form. I am using MS access 2007 - 2010.i am using below code but getting error.
I use to Navigation form called "frmMain" and it's subform is "Transactions" and "frmTransactionsDetail". I just want to pass value from a field in "Transactions" Subform to other field in "TransactionsDetail" Subform by command button with vba syntax.
And Other one thing I want that, when I click a button Subform will refresh with vba syntax. How to refer.
I am attempting to create a Navigation Form to allow another computer in my network to be able to utilize necessary forms within a database (through RunTime). I was hoping this would be a clean task by simply loading the forms into the tabs of the Navigation Form, however that is clearly not the case.
For starters, When attempting to use a form that has some VBA behind it (Docmd.ApplyFilter based on a selection from a combo box), I am given the error stating: "The action or method is invalid because the form or report isn't bound to a table or query."
After searching on this error, I believe it's because my Navigation Form does not have a record source. If this is the case, then I am confused as to what record source it should have, as with the 3 forms I need to access through the Navigation Form all pull data between various tables and queries within the database (some not related).
Now I've also come to the conclusion that my VBA references now must change in order to correctly use my forms. A correct reference would look something like:[Forms]![Navigation Form]![NavigationSubform].[Form].[My Form's Control]..Is this necessary in order to write any events, such as an AfterUpdate on a combo box?