Forms :: Requery 2nd Subform When Different Record Highlighted On First Subform

Sep 3, 2013

I have two sub forms on a main form.Subform 1 displays information which comes from a query, filtered using two combo boxes on the same form.The active record on the data sheet has two field values output to hidden text boxes on the form.

These text boxes then provide the values used for the query displayed on the 2nd sub form.When I highlight a new record in subform 1, the text box values change, but the values in sub form 2 do no.Which would be the best method to use to get this to requery?

View Replies


ADVERTISEMENT

Forms :: Open A Form For Adding Child Record Related To Highlighted Record In Subform

Oct 2, 2013

Is it possible to open a form to add a child record related to the highlighted record in the subform?

View 2 Replies View Related

Forms :: Requery Subform After Deleting A Record

Nov 8, 2014

I'm trying to execute some lines of code right after deleting a record in a subform, with a right click on the row I want to delete (the idea is that if a record is deleted the other ones should be updated by module1.tblUpdateLatestDocuments).

I've tried putting this code into the events On Delete and After Del Confirm of the subform, none of that worked.

Code:
Option Compare Database
Private Sub Form_AfterDelConfirm(Status As Integer)
Call Module1.tblUpdateLatestDocuments
Me.Requery
End Sub

Private Sub Form_Delete(Cancel As Integer)
Call Module1.tblUpdateLatestDocuments
Me.Requery
End Sub

Aren't there any events that I could use right AFTER the record has been deleted?

View 10 Replies View Related

Forms :: Create New Record In Form - How To Requery Subform To Link Properly

Apr 2, 2013

I have a form (frmAddManifest) with a subform (subfrmManifestTransporters).

When creating a new record, I can enter data into frmAddManifest, but the subform doesn't update to link with the record - I presume it's because the record from the main form hasn't been completed yet.

Is there a way to requery the form and/or subform so it stays on the record I was working on, and link the subform properly?

View 4 Replies View Related

Forms :: Get Subform To Requery After Choosing A Name From Combo Box On Subform Itself

Jul 26, 2013

All I am trying to do is get a subform to requery after choosing a name from a combobox on the subform itself, thus updating the records on the subform. The main form name is "BasicTestOneF" the subform name is "ICminiBasicF" and the combobox name is "Combo4"

I have the combobox requery on After Update, but I still get the "Enter Parameter Value" popup. I've spent the last hour and a half just trying to get this simple thing to work and have gone through I don't know how many sites and forum posts, tried every combination of VBA code I've found, and I still can't get it to work.

View 14 Replies View Related

Forms :: Requery Subform From Another Subform

May 8, 2014

I have a main form with a couple of tabs, forms and subforms (see attachment). The problem is that when I click on one of the blue record navigators, I want the right subform to requery. I can't get that to function properly.

Until now I'm just using the Macro Builder and little to no VBA. There is a function Requery in the MB, but I keep getting error messages that the object doesn't exist or nothing happens at all.

I've read the page on Access mvps about linking to forms, but I'm still doing something wrong.

When I used some VB like:
Me.Parent!frmStagesPerLeerling2.Form.Requery

it did work, but I an into problems with setting the visibility of the navigation buttons (they should only show when there is more then one record in that subform).

View 3 Replies View Related

Requery Subform - Not Same Record

Sep 23, 2005

Hi. First off I want to say that these forums are a gold mine. You all do a great job. Keep it up!

I work at a University and keep a database of students. On the main form for the student, you select their name from a combo box and the whole form refreshes to show the data for your selection. There are four subforms that keep track of things like a questionnaire, career center visits, etc. The problem I am having is with the Career Center visits.

There is a button that allows you to make an entry into a log when they come into the career center. Clicking on it opens up a small window where you can put notes and with whom they spoke while they were here. Upon closing the window, it adds the entry to the log for that particular student. That all works great. Each student has their own log...all is good.

However, upon closing the window, the main form jumps back to the first student in the list. The entry is added to the correct student, but you must find the student from the combo box in order to see it. It is just annoying to have to do it and I would like to fix it. Can't figure out why it is doing it, though.

Any ideas? I would like it to add the entry to the student, and stay on their record.

View 5 Replies View Related

Requery Subform From Another Subform Both Connected To Main Form

Aug 8, 2014

I have a main form that has two subforms, subform1 and subform2, both connected to the main form. When I enter data into a field in subform1 I want subform2 to requery and update to show the calculated results from the new or changed data in subform1.

I found that if I do a refresh it works when changing the data but not when entering a new line of data in subform1. I tried some code in the after update field of on subform1, but cannot seem to get anything to work.

Me.[subform2].Form.Requery

Does not work. It errors and says it cannot recognize subform2 as a field. I have tried a field name on subform2 but I still got the same error.

View 1 Replies View Related

Forms: Requery A Subform From Another Form

Apr 18, 2005

I need to requery a subform from a third form and can't seem to get it to work.

frmForm1 has frmAddress as a subform. The button cmdReviseAddress opens the form frmUpdateAddress where all of my validation work is done and the new record is added.

However, the new address is not being displayed in the subform.

If I use the command
Forms![frmTest]![frmAddress].Requery
it works fine.

The problem is that I want to be able to frmAddress on any form, and need to pass the name of the main form (in this case frmForm1) as a variable.

If lsTemp = "frmForm1", the statement
Forms![lsTemp]![frmAddress].Requery (and every variation using brackets and quotes that I can think of) fails.

Any ideas?

Thanks!

View 3 Replies View Related

Forms :: Cannot Requery Combobox On A Subform

Apr 2, 2014

I have a main form that identifies a Client File: frmClientFile (Single Form)

On the main form is a subform for Cases: subfrmCases (Continuous form)

Also on the main form below the Cases subform is a tab control that contains additional subforms to view/update different aspects of a case: subfrmCaseClients (Continuous Form).

The way this operates is that the user first chooses a file using a combobox on frmClientFile.

The subfrmCases is linked to the main form (using the caseFileID) and filters correctly.

The subfrmCaseClients is then linked using some hidden text fields on the main form (using caseFileID, CaseID) and this filters correctly.

On subfrmCaseClients is a combobox (cboClientID) that I need to requery based upon the Case Row selected on subfrmCases.

I have tried numerous combinations of options to force the requery by trying to apply a macro on the following:

OnCurrent, OnSelectionChange, OnChange and AfterUpdate events to no avail.

If I hit F5 to refresh the entire page the combo box gets updated as expected.

How do I get the Requery to work programatically? Is this even possible?

View 2 Replies View Related

Forms :: Requery Subform After Filter

Dec 10, 2013

I have a main form (Frm ViewModel) with a subform (Frm class_attributes) in datasheet-mode based on a Query.Frm ViewModel has two controls, a ComboBox Select Model (presents you with a list of data models ) and a ComboBox Select Class (presents you with a list of Classes selected from a class-table, based on the model-id derived from the Select Model ComboBox). The subform Frm class_attrbutes shows you all class attribute combinations based on the model-id derived from the Select Model ComboBox.After the initial selection of the classes and attributes, the subform Frm class_attribute can be filtered on class by the Select Class ComboBox.

As long as I just switch between models through the Select Model ComboBox, it all works fine. The subform Frm class_attributes is updated (Requery) correctly.The problems start when I filter the subform Frm class_attributes, either through VBA OR by using the GUI filter possibilities of the sub form itself.

Private Sub select_class_AfterUpdate()
[Forms]![Frm ViewModel]![Frm class_attributes].[Form].Filter = "class.object_name ='" & [Forms]![Frm ViewModel]![class_name] & "'"
[Forms]![Frm ViewModel]![Frm class_attributes].[Form].FilterOn = True

The filter works fine, but once youve used it:
- The filter stays active, even when turned off, so when you Requery the subform it reutrns results with the original filter.
- The filter is removed, but now the subform after requery keeps showing the selection of classes & attributes for the model_id where the filter was first set.

I tried all possible combinations of FilterOn = False and .Requery but it doesnt solve it. I tried reassigning the RecordSource but since the underlying SQL is extensive (a few joins) Access seems to have a problem with this

[Forms]![Frm ViewModel TST]![Frm class_attributes].RecordSource = "SELECT [class.hierarchy],
[class.object_name], [class.technical_name], [class.definition], [parent_class.object_name]
AS ParentClassName, [parent_class.level], [A.AttributeName], [A.AttributeTechnicalName],
[A.AttributeDefinition], [A.AttributeType], [A.AttributeTypeDescription] FROM [parent_class]

[Code] .....

I tried making the sub-form a bound form by manually linking the masterfield to the Select Class ComboBox..I played around with the On-Focus and OnCurrent-events

View 4 Replies View Related

Forms :: Highlight Unbound Subform Record That Matches Other Subform Record

Jan 22, 2014

I have two unbound unlinked subforms residing on a 3rd unbound main form. When I enter the current record on Subform1 I would like the matching record(s) on Subform2 to be highlighted or otherwise formatted. I can get this to work for only the first record on subform2 due to the way I have my code setup on Subform1:

Code:
Private Sub Accounting_Unit_Enter()
'find where AUs match. only works for first Subform2 record
If Me.[Accounting Unit] = Forms!MainForm.[Subform2]!AccountingUnit Then
msgbox "Match"
End If
End Sub

My thought was that I needed to reference the Recordset of Subform2 and search for all AccountingUnits that match the current AccountingUnit of Subform1,

View 6 Replies View Related

Modules & VBA :: Update Subform Requery Other Subform

Oct 5, 2013

i have a main form with three sub forms on it. when i update subform 1 i want subform 2 and 3 to update..currently i have an after update event in a combo box subform 1

Code:
[Forms]![FRMDATESUM]![frmHOURSUMnowork].Requery
[Forms]![FRMDATESUM]![frmHOURSUM].Requery

when the user updates the combobox in subform one nothing happens to the other subforms until close and reopen main form

View 2 Replies View Related

Forms :: Requery Subform After Exiting Popup

Aug 3, 2014

I have my main form which is f_main.

On there is a Subform called subfrmFront and that has a source object of the form f_front

A button on f_main opens up a popup. In this popup, the fields I am updating all relate to the same records that are being displayed in the subform. Everything updates OK in the popup (i.e I can see in the table that the updated information is in there), but the subform back on f_main still has the old data in it.

I need to requery that subform to show the new data I just inputted.

If I close f_main and re-open it, the latest data is in there, but surely there is a way to make sure it updates on the close of the popup form.

View 14 Replies View Related

Forms :: Selecting Record In Parent Subform From Child Continuous Subform

Jan 26, 2014

I have two subforms on a main form. Both use similar queries and nearly the same set of records and PK. The first subform is for data entry and the 2nd subform is a continuous form that lists the entries in order that are made from the 1st Subform. (for entering in vacation days and appointments)

The continuous form cannot be edited, it is to be a list for viewing the information only.

I have an edit button next to each record on the continuous form. When the button is clicked, I want it to take the 1st subform to that specific record as well (same PK), so the information can be edited there.

I cannot figure out how to get the 1st subform to go to the record on the continuous form when the button next to that record is clicked on the continuous form.

I tried the DoCmdSearch for record and just keep getting object is not open errors.

View 2 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 :: Update / Requery Subform Through On Close Event Of Another Form

Aug 2, 2013

I am working with 2 forms and a subform.

frmTaskTracker -subfrmInbox (Datasheet View - based on a query)

frmUpdateInboxItem

subfrmInbox displays a summary of tasks on a task list. The user navigates to frmUpdateInboxItem from frmTaskTracker. After updating a record from frmUpdateInboxItem, it is possible that it the record in question will no longer meet the requirements to have it listed on subfrmInbox.

I have attempted to add code to the on close event of frmUpdateInboxItem to requery the sub form on frmTaskTracker but am not getting the syntax correct.

correct my code? Alternatively is there is a more correct way to do this, I'd be happy to learn it.

Code:
Option Compare Database
Private Sub cmdClose_Click()
Me.[frmTasktracker]![subfrmInbox].Requery
DoCmd.Close acForm, "frmUpdateInboxItem"
End Sub

View 5 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

Requery A Subform Of A Subform

Jul 10, 2007

Hi,

I have tried to Requery a subform of a subform, but I can't get it to work.
I tried this:

Me.SubForm1.Form.SubForm2.requery

Also:

Me.SubForm1.SubForm2.requery

And:

Forms![SubForm1]![SubForm2].Form.Requery

Any help will be very much appreciated.
B

View 2 Replies View Related

Forms :: Requery Form And Subform After Popup Form Close

Aug 19, 2013

I tried all sorts of permutations of the requery command but apparently I'm too dense to figure it out.

Form 1
subform 1 > button to open pop up form
subform 2
subform 3

I'm trying to requery a combo box (inside of subform 1) based on a table that is updated from the pop up form.

On pop up form close, what's the correct syntax for re-querying subform 1?

View 2 Replies View Related

Requery A SubForm

Jun 21, 2007

Hi,

I want to requery a SubForm using the on Click event of a combobox that is located on the main form. I used this code below, but it does not work.

Forms![frmSite]![subRoadsConstructionConsent].Requery

Any suggestions please,
B

View 6 Replies View Related

Requery SubForm

Jan 26, 2005

I'm trying to requry a sub form based either or both text boxes. I need help with the code. I'm trying to rewrite something from a sample but can't seem to get it to use the criteria. It does requery though.

Private Sub cmdSearch_Click()
Dim sCriteria As String
sCriteria = "WHERE 1=1 "



If Me![Search] <> "" Then
sCriteria = sCriteria & " AND MedicalRecordsUpdating.SerialNumber """ & Search & """"
End If

If Me![SearchEvent] <> "" Then
sCriteria = sCriteria & " AND MedicalRecordsUpdating.Event """ & SearchEvent & """"
End If



Forms![RecordManagment]![FrmMedicalRecordsUpdating].Form.Requery

End Sub
Can some one steer me in the right direction

View 5 Replies View Related

Subform Requery

Mar 21, 2006

I have a form that contains a subform, upon clicking the notes button a new form is presented. Upon saving data I want the form to requery the publishers sub form here is my attached code:

Private Sub buttonsave_Click()
DoCmd.Save
Forms!Publisher![Notes subform].SetFocus
Forms!Publisher![Notes subform].Requery
DoCmd.Close
End Sub

The for does not requery I have to move to the next record and come back to see the new updated notes. TIA

View 5 Replies View Related

How To Requery A Subform

Feb 17, 2004

I'm having trouble updating a combo box automatically. I have a main form [Orders] containing a combo box with a list of Buyers. Inside this main form is also a subform, [Order Details], containing products to be ordered which is also selected by a combo box. However, each buyer has a different set of products. I tried filtering for only the products by a certain buyer but when I go to a new record, the product list remains the same according to the buyer on the first record when the form was opened. What do I need to do inorder to have only the products for the chosen buyer appear in the combo box when a buyer is selected in the main form?

View 5 Replies View Related

SubForm Combo Box Requery

Jun 24, 2005

I am a newbie to access and am having some difficulty with a subform. I have searched the forum, but could not find an exact match to my problem.

The following is a simplified version of my problem:

Tables: TSerialNumber, TLocation, TSubLocation(Location and SubLocation Fields)

Form: ServiceForm
SubForm: ServiceSubForm
Form and SubForm linked by SerialNumber

In the SubForm: I have 2 ComboBoxes: Location, SubLocation
Location - Row Source is the Table TLocation
SubLocation - Row Source is a Query of SubLocation relating to the Location

I need the SubLocation field to be requeried OnChange from the Location ComboBox.

If I use the subform as a form I can get this to work by using a macro to requery the SubLocation, but when I try to use it as a subform I get an ApplyFilter Error.

Thanks in advance for any help.

View 3 Replies View Related

Subform Requery Problem

Jul 25, 2005

Hi there,

I hope someone can help... and i hope i can explain this properly.
Some background... I have a form which has a Global ID as one of the fields.
From this form another audit results form can be opened (on the click of a button) that shows the results of Audits based on this ID. The results of audits are in a flat un-normalised table(this is not an issue at this point)

On the top of the audit results is a textbox for the 'GID', the contents of which have been copied from the original form where the button was located. This process uses a macro.

OpenForm
Set Value
[Forms]![frm_Audit Result]![Audit Result GID]
=[Forms]![frm_Call Log]![txt_Global ID]

The audit results form has a subform which displays the result of a query based on the the value that is copied.

The txtbox displays the value fine, but the subform does not display the result of the query.

The query has number of fields but the criteria for filtering the correct ID's is:
[Forms]![frm_Audit Result]![Audit Result GID]

Its just that the subfrom does not display any result as soon as the audit results form is launched. If I alter the number in the text box and hit enter, the subform displays the correct results.

The subforms Record source is the query.

I've tried numerous ways around the problem with various attempt to update the query on various events, but have had no luck.

I guess i need to rerun the query and then refresh the subform once the main form has the GID copied over... but am not sure how to rerun the query and at what point/with which event?

Any pointers are much appreciated.

View 6 Replies View Related







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