Forms :: Referring To Text In A Table On Subform
Mar 3, 2015
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?
View Replies
ADVERTISEMENT
Apr 17, 2013
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.
View 2 Replies
View Related
Jul 21, 2014
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.
View 14 Replies
View Related
Aug 14, 2014
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?):
txtActualHQPValue -
=([subfrmHQPProject].[Form]![TxtSubtotalHQPCalc])
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!
View 3 Replies
View Related
Jul 3, 2006
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]
Any suggestions
Thanks in advance
Nicolas
View 2 Replies
View Related
Nov 15, 2004
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 hope that this is enough info.
View 2 Replies
View Related
Nov 30, 2006
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?
View 1 Replies
View Related
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?
View 2 Replies
View Related
Feb 22, 2013
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
View 5 Replies
View Related
Jan 6, 2014
My database has Main form and a Sub form. On main form i place one unbound text box named investigations. In subform of which datasheet there is a column named TestCode. I want unbound text box (Investigations) to display row values which selected in a column (TestCode) of subform.for example:Investigation field should display "CBC,HB,ALP".
View 5 Replies
View Related
Sep 30, 2013
I have a simple date stamp that works great in a private sub within a form. (error handling removed for clarity)
Code:
Private Sub btnDateStamp_Click()
' UserInit is global variable
Me!Notes.SetFocus
Me!Notes = Chr$(13) & Date & " - " & Time() & " - " & UserInit & _
" -" & vbCrLf & Me!Notes
[code]...
I am rewriting it as Module function that is Called from various forms, to save space. The function receives the parameters varFormName and varControlName. I wish to write the results of the function back to a memo field on the form.I am stumped at the get go by the need to refer to the Forms controls with a full reference instead of the Me command.
Code:
Function DateStamp(varFormName As String, varMemoName As String)
'varInitials, varFormName, varMemoName are global variables
Forms!varFormName.Controls!varMemoName.SetFocus ' Error here
'Me!Notes = Chr$(13) & Date & " - " & Time() & " - " & varInitials & _
[code]...
how to refer to the forms control's with their full reference, from within the Module's function, the rest will fall into place.
View 3 Replies
View Related
Apr 19, 2013
I'm trying to run an if statment, on the records in a field (called "Current_Month"), in an existing table called ""Current_Months_Lag1_Data".
The IF statements work fine - and simply perform a different action for different data in "Current_Month".
I am having problems referring to "Current_Month", where I keep getting 424 (Object required) and 3420 (Object invalid) error messages, on the last line of code.
I have defined & identified the table in which the field is located, yet somehow cannot identify the field within that table. (I've already tried searching the web for similar problems under error messages 424 & 3420).
Function LAG_Forecast_03()
Dim dbs As Database
Set dbs = CurrentDb
Dim Tbl As TableDef
Set Tbl = CurrentDb.TableDefs("Current_Months_Lag1_Data")
Dim FLD As Field
Set FLD = Tbl![Current_Month]
View 6 Replies
View Related
Jul 25, 2013
I have a mainform and a datahseet subform.
Mainform = FrmProj_ProjectEntry
Subform = FrmProj_ProjectEntry_Sub1
On my mainform I have a text box (FrmProj_ProjectEntry.txtDueDt) where I enter an expected date.
On my subform I also have a textbox (FrmProj_ProjectEntry_Sub1.txtDueDt) for entering an expected date.
I would like the entered date on the mainform to become the default expected date on the subform for new records only. Once records are created the expected date can then be changed for each record.
How would I achieve this on an after update event on FrmProj_ProjectEntry.txtDueDt?
View 4 Replies
View Related
Nov 14, 2013
I am trying to sum the values in a textbox on a subform using a textbox in that subforms footer. Currently I have the textbox's control source to be this:
=Sum(IIf([chkInvoiceSent]=True,[txtPaymentAmount],0)).
This isn't filtering the appropriate records and is instead summing everything.I want to sum payment amount only if the chkinvoicesent box is checked off. Is the proper way to do this with a Dsum? I wanted to do it with the sum because it is faster and more elegant, or so I thought!
View 3 Replies
View Related
Jan 2, 2015
I am trying to get a subform to be hidden when the value of a textbox (txtAllocationID) is empty but when a ID number appears I would like it to become visible again.This is what I have tried so far but doesn't seem to work:
Code:
Private Sub txtAllocationID_AfterUpdate()
If Me.txtAllocationID.Value >= 0 Then
Me.frmStockAllocated.Visible = True
Else
Me.frmStockAllocated.Visible = False
End If
End Sub
My allocation ID is a primary key so all auto number generated and only an integer.
Scenario: When I enter a stock ID of 121 and search I want the subform to remain hidden as there is no Allocation ID related to that Stock ID (see attachment tblAllocated). If I was to enter a stock ID of 122 I want the subform to become visible as the stock ID has a relation with the Allocation ID 6 and therefore the textbox txtAllocation ID would display '6' in it.
View 2 Replies
View Related
May 23, 2013
I have researched but couldn't find any working filter criteria for subform criteria.i have used the code, searching the web but still no luck.I have attached the picture and sample northwind database (accdb). I just want to filter customers in Orders navigation using text criteria.
View 9 Replies
View Related
Jun 24, 2015
I have a continuous subform with an unbound Concat textbox and would like to populate another field for each record with the results with a main form button onClick event.
How do I accomplish this?
View 2 Replies
View Related
Apr 2, 2015
I have a continuous subform which essentially comprises of a textbox that shows a field from a query.
The text in that box is essentially a few letters and a few numbers - what I am wondering is if I can have an on click event for the textbox, that when a user clicks the text it takes them to the record (in a different form) that matches the text contained in the textbox they clicked?
View 1 Replies
View Related
Jun 28, 2014
I have a form with a subform in it. The Subform relates to a junction table.
For each record on the main form, there may be more than one record on the subform. The Subform only has one field on it (a combobox).
What I want to be able to do is have a text box on the main form that shows a concatenated list of all of the records on the subform.
For example, if I have 2 subform records, 'Yellow' and 'Blue', I want a textbox on the main form record to show 'Yellow, Blue'.
I have tried so many things I have found online (over about 5 hours, including a module called ConcatRelated) and absolutely nothing works!
View 5 Replies
View Related
Oct 27, 2013
I wanted to build a dynamic search form using text box instead of the common combo box type.
I found an example that used the combo box and the searching portion of the code is as followed:
Code:
If Nz(Me.txtID, "") > "" Then
If Len(Nz(strFilter)) > 0 Then strFilter = strFilter & " And "
strFilter = strFilter & "CategoryID = '" & Me.txtID & "'"
bFilter = True
End If
How to insert (Like "*" & Me.txtID & "*") into the code to make the dynamic search using text box possible.
View 1 Replies
View Related
Jul 12, 2015
I want to show an subform where in I would like to display images,txt,xlsx that are stored in a directory as icons which when clciked would open the respective files.The info related to the images are stored in t_CustomerFiles.
Record ID, CustomerID, DestinationPath,EventFileName,
1, A, C:UsersTestDesktopCustFiles, CustA1.jpg
2, A, C:UsersTestDesktopCustFiles, CustA2.xlsx
3, B, C:UsersTestDesktopCustFiles, CustB1.txt
4, C, C:UsersTestDesktopCustFiles, CustC1.jpg
5, C, C:UsersTestDesktopCustFiles, CustC2.jpg.
I would like to show them on a continusous sub form .. I am using image control by setting its control source property but it does not seem to work..Do I need something else for the xlsx and txt files..
View 2 Replies
View Related
May 22, 2015
I have a tabbed form from which the user can select a contact's record from a subform on the first tab, click a edit command button, and the unbound text boxes on the top of that tab populate. The user can then click the second tab with employment history which has blank unbound text boxes and another subform which is linked by the contact id to the first tab.
The user can select a record in the second tab, click a command button and the text boxes populate no problem. The problem comes when the user changes the contact on the first tab, and then tries to edit a record on the second tab. Then I get a run-time error '-2147352567 (80020009)' saying the value you entered isn't valid for this field. Why it would work the first time by not the second?
View 7 Replies
View Related
Mar 10, 2013
I have a Form called X which contains a subform called Y. I have placed this Form inside another form called Z.
There is a CommandButton which when clicked must refer to the Subform. How do I do this?
I tried using [Z]![X]!Y, Form_Z.Form_X.Y, [Z]![X].Y but it throws an error saying the form name has been misspelled ...
View 4 Replies
View Related
Apr 6, 2006
I know that to refer to a field in a different form we do sthing like this Forms![Products]![Product name] (for example). But when i try to use it in a query under criteria with the "Like" expression it treats it as normal text.
What i basically need to do is have a form used as a search facility where one enters information then clicks view (which is a button that opens a datasheet filtered from the query which should have its criteria referring to the information entered in this form).
What i did:
Under the "product name" criteria in the query i entered:
Like (*Forms![SearchForProduct]![Product name]*)
When i press enter it automatically puts the inverted commas and treats it as normal text and does not refer to this form. Anyway, i created a form from this query called "Product search results" then inserted a command button in the "SearchForProduct" form (next to the "product name" field) which opens up "Product search results" . It does not work at all, because as i said before it does not refer to the form. This way of referring to another form worked with many other queries, but with the "Like" expression it doesnt work.
If someone knows an alterantive way of doing this please help me (even if it involves visual basic).
thanks
View 2 Replies
View Related
Dec 13, 2013
I have a form that contains the following: Combobox, (Lists BadgeNum from tblPersonnel)
2 Textboxes (LastName, FirstName) populated via code from the combobox using info from the same tblPersonnel.
2 labels (one containing Date, another containing Time)
ToggleOnButton (Valueof 1)
ToggleOffButton (Value of 0)
Savebutton
This form is basically used as a cheap police timeclock. All Im trying to do is when a user chooses their name from the combobox, clicks ON or OFF and then save, is just write the much of the same info to a table. Specifically, BadgeNum, DateIn, TimeIn, DateOut, TimeOut.
View 4 Replies
View Related
Nov 9, 2014
I have a many to many relationship between tblMain and tblComp, where the junction table is jtblMain_Comp. The real life scenario is one person can have many complications, and each complication can be encountered by many people.
I've set up a form with a subform, to enter multiple Comp. I thought that by defining the relationship, the MainID would be entered into the junction table whenever a Comp is entered, but I'm clearly missing a step.
View 3 Replies
View Related