Forms :: Nested Subform Control Value

Jun 19, 2014

I have a main form (frm_main) in which I have a subform as a datasheet (frm_sub1).In the first sub form I have a second (nested) subform (frm_sub_sub2) as a datasheet as well.

On the main form I have an unbound text box which gives me the value of the ID field in the nested subform (frm_sub_sub2).In the main this works well, however, I hit a problem at a particular point.

If I expand an entry in the first subform (frm_sub1), then, in the main form (frm_main) I get the first ID value from the corresponding records in the nested subform (frm_sub_sub2) as expected, which then changes as I scroll through the expended records.

However, if I then expand another entry in the first subform (frm_sub1) without collapsing the previous entry, the ID value shown on the main form (frm_main) from the nested subform (frm_sub_sub2) remains the same and doesn't change to the currently selected record. Even if I then collapse the first selected entry on frm_sub_sub2 - the original ID value still remains on the main form (frm_main).

View Replies


ADVERTISEMENT

Forms :: Syntax To Refer To A Control On Nested Subform In Access 2013

Mar 20, 2014

I have searched to find the correct syntax to refer to a combo box control on a nested subform. All the examples I've found Access 2013 will not recognize or find the appropriate control.

I have a parent form called IncidentDetails. On that form I have a control called ctrlLogDetail. Within that control is a form called sfrm_LogDetail. On sfrm_LogDetail, I have a control called ctrlType which houses a form called sfrmType. On sfrmType, I have a combo box called cboType. I need to be able to place the cboType choice into a query to filter records for another combo box on that same form. the query works appropriately when I have sfrmType open, however as soon as I try to call the query from the IncidentDetails form, Access cannot find the cboType control.

I've tried multiple variations of the syntax to call to cboType that I've found online. I found a very useful reference from BTA Development: however the syntax there will NOT work in Access 2013.

What is the appropriate syntax would be to get to my control within my 3 deep nested subform? I'm working Access 2013 and won't have a choice regarding Access versions.

View 5 Replies View Related

Reports :: Nested Subreport With Control Parameters

Jun 30, 2014

I have a report with a nested Subreport. Main Report>Subreport1>Subreport2, for simplicity.

I have master/child set up for both Subreports, but I would also like to filter the Subreport2 records with a date range parameter.

Is there a way to get the Subreport2 where clause to recognize the Subreport1 control I want to use for the date range?

So far I have tried:

Between Int([Reports]![Processing_Performance_Req_Dataset]![report]![QC_Static_Processing_Subreport]![Collection_Date]) And (Int([Reports]![Processing_Performance_Req_Dataset]![report]![QC_Static_Processing_Subreport]![Collection_Date])+0.9)

Between Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport]![Collection_Date]) And (Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport]![Collection_Date])+0.9)

and

Between Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport].[Report]![Collection_Date]) And (Int([Reports]![Processing_Performance_Req_Dataset]![QC_Static_Processing_Subreport].[Report]![Collection_Date])+0.9)

where Processing_Performance_Req_Dataset = Main Report
QC_Static_Processing_Subreport = Subreport1
and Collection_Date = textbox control on Subreport2.

Is there a syntax error? I have other, single level, Subreports on the main report with a similar data range parameter that work just fine. Or does this type of parameter input not work on second level Subreports? Every time I run the main report it asks me for a parameter but doesn't accept my input, and Subreport2 doesn't load any records.

View 4 Replies View Related

Forms :: Referencing A Subform Control From Another Subform

May 27, 2014

On a main form i have a continuous subform listing Jobs.

On the Click Event i want to display the personnel and equipment separately in two additional subforms linked to the Job i have clicked on by JobID.

I have tried all sorts of references and currently have this:-

Forms!PersonnelAndEquipmentMovementFrm.PerEquipMov Jobs.JobID = Form!EmployeeSubform.JobID.Text

Which does not work?

View 4 Replies View Related

Forms :: Subform Control Event - Identify Parent And Child Forms

Jun 20, 2013

I have a listbox on a subform (or a subform within a subform).

When it is clicked I want all other listboxes to unselect.

There may be listboxes on the mainform, on other subforms, on other subforms of subforms.

I imagine I'm looking at a recursive function of some sort, but I'm not entirely sure of syntax to identify parent and children forms...

pseudocode so far:
loop all controls
if control = listbox, unselect all
if control = subform - recurse: loop all subform controls
if control = parent... err... Fail.

View 3 Replies View Related

Forms :: Navigation Form - Using DB Forms Under Its Subform Control

Jun 19, 2013

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?

View 4 Replies View Related

Forms :: Set Focus On Subform Control?

Mar 7, 2014

I have a form with a subform on it. The subform has subforms. I need to set the focus on a control on one of the subforms. Here is what I am using.

START OF CODE
Forms!frmMain!frmMainSub.Form.frmContactLog.SetFoc us
Forms!frmMain!frmMainSub.Form.frmContactLog.Contac tMethod.SetFocus
END OF CODE

I use Code 1 to get to the third level. Code 1 works.

Code 1
Forms!frmMain!frmMainSub.Form.frmContactLog.SetFoc us

When I add the second line, Code 2, it doesn't work. I get the message "Run-time error 438: Object doesn't support this property or method."

Code 2
Forms!frmMain!frmMainSub.Form.frmContactLog.Contac tMethod.SetFocus

View 2 Replies View Related

Forms :: Set Source Of Control Box To Subform

Mar 30, 2013

I have a subform called DD subform

I have an unbound combo box named Target

How to I set the control source of Target to reflect my DD subform?

In control source, my only choices are the fields related to the subform, not the subform itself.

View 1 Replies View Related

General :: Limit Number Of Entries Into Nested Subform?

Nov 28, 2014

I am currently trying to figure out how to limit the entries into a nested sub form to just one.

for example im making wine collection database, I have a PURCHASE table, a WINE table containing the FK of the PURCHASE PK, and an INVENTORY contain the FK of the WINE PK.

a purchase can contain many wines, but one wine can only be in one inventory location.

I am trying to add all this information with one form. I fill out the purchase details, enter the info of X bottles of wine were in the purchase, and then with one of those wines selected in their subform, i enter the inventory details for that wine. I go select the next wine in the first subform and the inventory nested subform doesnt allow another entry.

I have this code loaded into the On Current event for the main form:

Private Sub Form_Current()
With Me![INVENTORY Subform].Form
If .Recordset.RecordCount = 0 Then
.AllowAdditions = True

[Code] ....

View 5 Replies View Related

Forms :: Update A Bound Control From Subform

May 3, 2013

I have a Main form with several sub forms on it the tables behind each form are related tables. The user enters data on the main form with the exception of one bound control then moves on to enter data on the sub forms On exiting the record or the main form I want to take data from several of the sub forms and add them together and enter result in the bound form on the main form. Because this bound control is not used to enter data in there are no event triggers to code to get this done.

View 3 Replies View Related

Forms :: Storing Calculated Control Of A Subform

Jul 5, 2015

Eventhough i know calculated control are for queries, I still need to store a calculated value of a sum. I have a form with customers, dates, locations. That form has a subform that contains the services done and materials used. This subform is in datasheet view. In the footer i have a control with =Sum([Price]).

So I need the value of this control to be stored in the table the main form is based on. I did an unbound control in the main form where the =Me!Subform.Form!.Textx will bring the value "over" Then for the on focus event the vba code Me.Total=Me.Textx stores the value. That is fine. The same works with a command button with the same vba code.

However i am asking if there is a more automatic way to get the value over without the unbound control/command button.

View 7 Replies View Related

Forms :: Control Max Number Of Records On SubForm

Sep 5, 2014

Is it possible to limit a subform to 3 records?

View 12 Replies View Related

Forms :: Requery A Control On A Form Pulled From Subform

Feb 6, 2014

how do you requery a control on a form pulled from subform? i've tried but it doesnt work

Private Sub Form_AfterUpdate()
[Forms]![Project_Details]![subform].[Form]![Text119].Requery
End Sub

View 6 Replies View Related

Forms :: CBO From Main Form To Reference Control On Subform

Mar 12, 2013

Ok, this is what I have:

I have setup my main form with 2 subforms to mimic a split form; this works fine.

To search for a record, I am using a cbo on the main form which I would like the user to select from. Once selected, then this will populate the first subform.

This is the code I have for the cbo:

Dim intAnswer As Integer
If IsNull(Me!cboCaseNoCFDWit) Then Exit Sub
With Me!sfFocus.Form.RecordsetClone
.FindFirst "Me!sfFocus.Form!CaseNumber = """ & Me!cboCaseNoCFDWit & """"
If Not .NoMatch Then
If Me.Dirty Then Me.Dirty = False

[Code] ....

I get an error at the .findfirst; states that the Microsoft Engine does not recogize Me!sfFocus.Form!CaseNumber

And the reason I am not using a regular split form is because I cannot, get the form to the size that I want. The splitform works great with the code above (a few changes to it of course), but the bottom of the splitform (datasheet) is too long and I cannot shorten it.

View 2 Replies View Related

Forms :: Subform Visible / Invisible Based On Control

Jun 18, 2015

I need to have a subform that shows up smack dab in the middle of my main screen when visible - which is what I want - but only based on a specific value of a control on the main form. Specifically, if a control's value is "See Spreadsheet", I want the subform visible front and center as it contains the link to the server location for that specific record. If the control's value is not "See Spreadsheet", I want the form to be invisible.

My code:

If Me.BudgetsFacultyAccountNumber = "SEE SPREADSHEET" Then
Me.frmMsgBoxUpdateSpreadsheet.Form.Visible = True
Me.BudgetsFacultyServerLocation.Visible = True
Else:
Me.frmMsgBoxUpdateSpreadsheet.Form.Visible = False
Me.BudgetsFacultyServerLocation.Visible = False
End If

The red lines result in an MS VBA error: "Compile error: Method or data member not found."

I've tried referencing that subform a hundred different ways, but I can't get it to work.

View 5 Replies View Related

Forms :: Filtering A Subform On Tab Control From A Separate Form

Sep 11, 2013

I am trying to filter a subform on a tab control based on an input on a second form.

Mainform: frm Index Page 2
Tab Control on Mainform: tabctrlMain
Subform: Customer Details
Tab Name: tabCustomerDetails

The second form is basically a separate Search Form where users can look for a customer ID and returns the ID back to Customer Details form.So far I have managed to redirect focus to the correct tab on the tab control using the following code:

DoCmd.OpenForm "frm Index Page 2"
With Forms("frm Index Page 2")
!tabctrlMain.Value = !tabCustomerDetails.PageIndex
End With

However, I am stuck with the filtering part. Everything was working fine before I began putting the forms together into one big tab control (I tried using Navigation Pane but there were too many referencing problems so I gave up on that one).

View 2 Replies View Related

Forms :: Display Different Subform Depending Upon Which Control Is Clicked

Aug 21, 2014

I am creating a database to manage multiple mobile devices. The table structure is complete and I'm trying to build a set of forms.

Simplifying things, I have tblUser, tblSim and tblDevice. I also have a tblJoin where you can select a UserID, SimID and DeviceID to create an item of inventory.

I have created a parent form (frmCreateInventory) base on tblJoin, so it has JoinID and combo boxes for UserID, SimID and DeviceID in the lefthand side.

I have also set up 3 sub forms sfrmUser, sfrmDevice and sfrmSim, based on their respective tables, which I want to display on the right hand side of frmCreateInventory.

I'd like to be able to create a subform control in frmCreateInventory, but change the subform it displays based on what combo box is clicked, e.g. if I click the UserID control, the subform displays sfrmUser, and the relevant data based on the UserID that is linked to the JoinID. if I click the DeviceID control, the sfrmDevice is displayed and the relevant info etc. etc.

Is this possible? if so, how would I go about doing this?

View 6 Replies View Related

Forms :: How To Refer To A Control From Subform To Main Form

Feb 5, 2015

I have Main Form is named MainFrm and it has

two Sub Forms :
- OrdersSubFrm
- DetSubFrm

I want :

if OrdersSubFrm is not contains any records DetSubFrm is not enabled

View 7 Replies View Related

Forms :: Reference Control On Main Form From Subform

Apr 2, 2014

I have a Main form 'frmEmployeeInjury' with a subform 'frmInjuryDetails'.On the subform is a date field 'dteDateofInjury' and on the main form a command button 'SaveRecord'

What I am trying to do is hide the command button on the main form until a date is entered in the 'dteDateofInjury' field.I have looked online and found information on main form and subform referencing, but I can't follow it very well without examples.

Code:

Private Sub dteDateofInjury_AfterUpdate()
Me.Forms![frmEmployeeInjury]![SaveRecord].Enabled
'Me.Parent.cmdSaveNewInjury.Visable
'Me.Parent.cmdSaveNewInjury.Enabled
End Sub

But I get 'method or data member not found'.

View 3 Replies View Related

Forms :: Subform - Combo Box List Not Populating According To Main Control

Apr 17, 2014

I am using MS Access 2010, I have three tables,

Policies (Id, Client Id, Address, Policy Amount, Paid)
Payments (Id, Client Id, Total Amount)
Payment Details (Payment Id, Policy Id, Paid Amount)

I have created a form "PAYMENTS" that include a sub form "PAYMENT DETAILS".

In the sub form control Policy Id is defined as combo box, and retrieving the list from Policies and Payments where Policies.Client=Payments.Client the query of Combo Box is as follows:

Code:

SELECT POLICIES.[POLICY ID]
FROM POLICIES
WHERE (((POLICIES.PAID)=False) AND ((POLICIES.CLIENT)=[Forms]![PAYMENTS]![ClientId]));

Only first time Combo Box display the Policy Ids according to the Client, but when I change the client and always displays the previous clients Policy Ids.

how to retrieve correct list of Policy Ids according to the Input Client in Payments.Client control

View 4 Replies View Related

Forms :: Control Form Command Button Based On Subform?

Sep 2, 2014

i have some command button and some combo box on my form and also a subform. the subform contains some field. the fields used to enter numeric values.

i need to disable my command button on the form based on the subform fields if they r null.

View 1 Replies View Related

Forms :: Textbox On Main Form Referring To Subform Control

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

Forms :: Requery Control On Subform From Main Form - Refresh List?

Sep 8, 2014

I have a form called Add New Delegation, i have combo box of Institution names on the main form and a subform for Agreements discussed. with a combo box called agreements. I successfully cascaded the combo boxes so that the agreements discussed on the subform are filtered by their respective institutions on the main form. However i am unable to refresh the list each time a new institution is selected as the Macro will not allow me to requery a control on the mainform from the subform..

View 2 Replies View Related

Forms :: Filter Based On Multiple Selections - Referencing A Control On A Subform

Oct 23, 2013

I have a multi select list box which I am trying to use to open another form and apply a filter based on the user's multiple selections.

List box - lstCatergories
Main Form - frmSuppliersSummaryCategories
Subform on Main Form - frmSuppliersSummaryCategoriesSubForm

The Subform contains the text box CategoryID

Here's my code which nearly works...

Code:
Private Sub cmdFilterSuppliers_Click()
On Error GoTo Err_cmdFilterSuppliers_Click

Dim strWhere As String
Dim ctl As Control
Dim varItem As Variant

[Code] .....

My problem is that the control "CategoryID" is on the subform and I'm having massive problems trying to reference it. This is the part of my code that won't work:

Code:
DoCmd.OpenForm "frmSuppliersSummaryCategories", acNormal, , "CategoryID IN(" & strWhere & ")"

However; if I open the SubForm directly it works perfectly. I.e.

Code:
DoCmd.OpenForm "frmSuppliersSummaryCategoriesSubform", acFormDS, , "CategoryID IN(" & strWhere & ")"

To summarise... How do I reference the control "CategoryID" on the subform "frmSuppliersSummaryCategoriesSubform"?

View 4 Replies View Related

Forms :: Continuous Subform - Control To Display Image / Icon Based On Another Field

Jan 9, 2014

I have a continuous subform which queries a table of attachments. I'm using Access 2007 but not using the Attachment datatype; this DB will grow considerably and I don't want to waste precious space by filling it with bulky files. So instead, I have code which makes a copy of the attachment and adds the hyperlink (to the copy) to the table instead.

Now - I want to add a control to the subform to display an icon / image reflecting the file type of the attachment (Word doc, Excel s/s, PDF etc.)

But not sure how to go about it.

I was thinking I could use FileSystemObject.GetFileExtension at the point in the code where the attachment is added, and add a new field to my attachments table (i.e. translate "*.xls*" to "Excel", etc.) Then store / embed a handful of images for the core types I would expect and use an image control on the subform to display the image based on the value of that field.

But is that even possible / feasible?

Or, is there a handy API which can retrieve the icon associated with a file type based on what has been installed on the local machine (even if there is, there's still the problem of setting up the image control to display the appropriate icon specific to each record...)

Or, is there another control available which would be better suited to something like this than an Image control?

View 4 Replies View Related

Nested Queries And Forms

Jul 23, 2007

Hey,

I am working on my first access project (please be patient and try to explain like to a child). My problems however are past the basic level so please bear with me ....

I am working on a datbase which deals with laboratory data from patients which have different date stamps - ie. each record has a 'valid time' (time of blood drowing) a 'transaction time' (time of entry into the DB) and 'delete time' (deleted recordes are just given a date and not really deleted).

The idea is that the user should be able to watch the status of the DB at different past dates (ie what did the doctor know about a patient blood tests a month ago when he made the decision to give him a medication which eventually harmed his kideneys). The user should also be able to change values of records, delete records (which means to add a date to the deleted date field) and to add new records.

I want to do it all using one form.

Things I have done so far:
1. Query by form which locates a specific record (Main-Form & singleRecQuery)
2. A subform in Main-Form which displays the results of singleRecQuery (Single-subform). The query and subform aer updated by a macro once I enter all the data into main-form.
3. A qury by form derived from Main-Form which locates a range of values (Range-subfrom & Range-Query)

My problem spans both forms and queries (so I am posting in both forums):
1. I want to create an update query that will draw its data from Single-subform (the form which displays the results of singleRecQuery). I have created the qury without a problem but the fields in the form are locked for entering data (maybe because they are bound). Is there any way to enter data in such a form which is based on a query and then use the new data in another query ? (I tried allowing data entery in the forms properties but it deos't work).

2. I have tried to put a criterion in the queries on the "Delete Date" field so that the quries will not display the deleted records (I have tried "is null" "is empty" and "is missing") but when I run the query with these parameters I get no records back.

3. In the form I have a command buton which runs a macro that runs the qury and then update dthe subform. Is there a way to get this button to run different macros after different events in the form or do I have to add a button for every specific task I want.

4. As I have mentioned the Main-fom is supposed to run 3 differnt queries and display the results on the same form. I know how to make a subform invisable but is there a way to place all three result subforms in the same spot ?

Sorry it is so long
Thanks
EJ

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved