Open Last Record In A Subform
Nov 30, 2006
Hi,
I have a form, with a subform in it.
I am trying to add a record through the subform then once added I want to display that record..
at the moment I add the record but the first record is shown.
I have tried adding :
DoCmd.GoToRecord , Forms!frmviewscheme![QScheme_Establishment subform], acLast
but recieve a run-tim error 2498.
can anybody help me ?
regards,
Ja
View Replies
ADVERTISEMENT
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
Dec 16, 2014
I am creating an events database. In my main form, I have all the details of a single event (billing code, fees, customer, support personnel, etc.). Then, I have a subform (form view) that lists each of the other services which share an event ID (this ID comes from a separate, unrelated events management suite). In the subform, I display the most-commonly-edited fields so that they are editable without navigating to a different record.
However, there will be instances where it becomes necessary to navigate to one of the records listed in the subform. I would like to make this a quick process by just clicking on the primary key in the subform, and have the corresponding record appear in the main form.
In my searches I've found a common suggestion to use a DoCmd.OpenForm method where the form opens to that specific record -- in effect filtering by the primary key number. I don't prefer this method because it disables the ability to navigate to other records using the previous, next, find records, (etc.) buttons without closing and re-opening the form.
Is there a way to make the main form 'jump' to a specific record by clicking on a control in the subform, without limiting the ability to navigate in the main form?
View 10 Replies
View Related
Feb 2, 2005
Hi All
I have a subform called frmProducts and on it I have 2 command buttons One is to use the current open form to jump to a particular product to make it easier to edit the details and the other is to use the current form and jump to a new record.
Now I have this working when running the form on its own but when I try and run it as a subform it does not work. I am not sure how to adjust the coding to let this happen.
the Main forms name is "MainForm"
Below is my current coding to open the form at a particular record
Private Sub EditProduct_Click()
Dim Msg As String
Dim Title As String
Dim Defvalue As String
Dim Answer As String
Msg = "Enter a Product Name: "
Title = "Open Prouct Form"
Defvalue = ""
Answer = InputBox(Msg, Title, Defvalue)
If Answer <> "" Then
DoCmd.OpenForm "frmProducts", , , "[ProductName]='" & Answer & "' "
Else
DoCmd.OpenForm "frmProducts"
End If
End Sub
Below is my coding to open the form at a new record
Private Sub NewProduct_Click()
DoCmd.GoToRecord , , acNewRec
End Sub
Many thanks in advance for all assistance
Sirch76
View 2 Replies
View Related
Mar 22, 2013
I open a form to a blank new record, then when using a combo box to select a record I need the subform to open to the last record. Having trouble doing that. Both form and subform are Single views.
View 1 Replies
View Related
Aug 27, 2006
Is there a way to automatically scroll a subform on opening so the subform is filled with the last few records along with the new record data entry line?
Thanks for any help,
Mike
View 10 Replies
View Related
Jul 27, 2015
I have a series of combo boxes on subforms whose control sources are fields in a table that has a many-to-one relationship to the main case-information table meaning that there will likely be several records for any case. I need each combo box to open onto the first record for each case rather than create a new record. I've seen code that does this, but under somewhat different conditions, and my VBA skills are too rudimentary for me to be able to adapt the code to my needs.
View 7 Replies
View Related
Mar 7, 2006
I am trying to open a single form with a single subform with a command button. I would like to open the form with the subform on a specific record but I am not entirely sure how to do this, I was wondering if someone had any advice that could help.
View 2 Replies
View Related
Aug 24, 2006
Hello, fantastic site you have here!
I have a form based on a table called TermWithPaysStoredData that shows a single row for everyone in the table with a small amount of info from the table and has controls for a user to enter dates which writes to that same table.
I have a subform that reads that same table but has much more information about each row. I would like to add a button to each row of the main form that says "More Info". When clicked, it should open the subform to the same employee.
The field I want to match is called ID. My main form is called fTermWithPays and my subform is called fTermWithPaysMoreInformation.
I tried using the OpenForm method but that either opens the form to the first record or filters and shows only one blank record.
I'd like to use a macro for this if possible because I don't know VB.
Any ideas? Let me know if more explanation is needed.
Thanks very much!
View 2 Replies
View Related
Jun 27, 2014
I got a form / subform relationship.how to locate the bottom record, when the user after some queries input at the main form. I desire to display the bottom end record (EOF), instead of some sorting and display the last record at top of the subform!!
View 11 Replies
View Related
Mar 3, 2015
I have a subform [ctrlLogDetail] on a parent form [incidentdetails] that is opened by the user when they click on a button on a navigation form. These forms are used for a variety of purposes. The problem I'm having is that the user needs to be able to select an incident number and go to the appropriate form (I accomplish this by using this code: DoCmd.OpenForm "IncidentDetails", acNormal, , "Activity_ID = " & Me.cboINum in the on click event of the button.) This works appropriately. The subform is also appropriately linked to the parent form.
I need an additional line of code to have the subform go to a new record when the form opens to an existing incident number. Since I use this form/subform when doing different tasks, having the Docmd.RunCommand acCmdRecordsGoToNew in the Form on open event isn't optimal.
I only want the LogDetail subform to open to a new record when the user wants to add an entry, but not when they need to edit a specific entry. What is the appropriate syntax to use either in the openargs event of the openform command or elsewhere in the procedure so that the gotonew function on the subform only occurs when this button is clicked? I'm having difficulty getting access to understand that I want the subform to open to a new record but not the parent form.
View 1 Replies
View Related
Sep 5, 2013
I have a form called GetdataFrm. Within it i have a combo box that filter a query. When the combo filters, it populates a continuous subform called GetDataQrysubform. GetDataQrysubform look like a table that contains this Jobcode information:
EmployeeID Jobcode CardAccess Folders Software
When I filter the GetDataFrm form, I want to be able to click on a Employee's EmployeeID number from a single record in GetDataQrysubform and then a form called SingleRefrm would pop up taking me to that record.So far I have a event procedure coded to open up SingleRefrm, when the EmployeeID field is clicked but its not working. The code looks like this:
Code:
DoCmd.OpenForm "SingleRefrm", acNormal, , "EmployeeID = '" & Me.EmployeeID & "'"
View 9 Replies
View Related
Jun 1, 2006
Problem:
Visual Basic run-time error 7792: You can't open a subform when it is also open in Design view.
I have a subform with properties for SourceObject, LinkMasterFields, LinkChildFields changing according to objects and events in the master form.
The subform was bound to a query before which meant that the subform load event was happening as soon as the master form is loaded. I needed to restrict the subform loading until a certain point so I removed the SourceObject property for the masterform's subform. The subform on the master form is now Unbound.
(This is because I'm now running some code on the FormLoad event for the subform which needs to be restricted until the LinkMasterFields and LinkChild Fields properties have been assigned correctly otherwise it takes ages to load.)
Now I'm getting the above error. Obviously, i do not have the subform open anywhere in design view. No Visual Basic windows are open. I've closed the db, closed access, reopened it and clicked on nothing except the masterform. The error occurs when I raise the event in the master form which assigns the sourceobject property to the subform, i.e.
Me.sfmQryAllOV.SourceObject = "sfmQryAllOV"
Can anyone help me? I've googled this but finding no answers.
View 1 Replies
View Related
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
Feb 5, 2005
I have a main form which has a subform control in it. when the main form is opened the sub form control contains a list of events in a sub form (a summary view), for the person selected in the main form.
I want to change the subform to a different one which shows the whole event when i click in a field on the subform, based on the event i clicked in. ( i can do it by opening a new form but not with a new subform)
I can make the form change using the following code:
Private Sub Notes_DblClick(Cancel As Integer)
Me.Parent.subformhere.SourceObject = "eventsfullrecord"
End Sub
What code do i need to make it open to the record i clicked in the summary form, rather than just opening to the first record every time?
Not very good at passing recordsets
Thank you
View 4 Replies
View Related
Apr 23, 2013
I have a form "IntUnderwriterSearchByName" which is based on the query "Search by Name". This form opens with a parameter (please enter name of broker) and is set out like a datasheet with the following fields- "Broker Name", "Domicile", "Broker Code" and a couple of others. I'd like to be able to click on a record and open the form "IntUnderwriterPopUp" so that the details of that specified record are displayed.
Broker Code is what I'd like the form to look for and this Broker Code is unique for every one of the 900 or so records. This code can be numerical e.g. 01233 but also can be a mixture of both e.g. EU2885. It is also worth noting that this code is not the primary key- i have an autonumber (called ID) that does this- but this field does not appear on the form.
View 7 Replies
View Related
Jul 28, 2014
I currently have a button that opens a report. the report pulls from a query that has parameters set to "fromdate" and "todate". instead of using dates and parameters that pop up as blank text boxes, I would like to click the button, have a form pop up with a combo box to select all of the options available (currently 23 options) and then click a button to make a report that only displays the record (1-23) selected. I do not need any time constraints because as the databases get updated with more records, there would be more than 23 options to choose from.
View 1 Replies
View Related
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
Mar 18, 2006
Hi,
I have a main form with 2 subforms.
I am trying to create records in the second subform based on records in the first subform nd the current record in the main form.
at present i can create the new record and paste information, however i cannot seem to advance records in teh first subform to repeat the procedure.
and code or macro i try returns a 'object not open' error
any help would be great.
View 13 Replies
View Related
Sep 4, 2014
I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?I have tried on afterupdate event on Contact_Details below but those don't work:
Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
View 11 Replies
View Related
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 10 Replies
View Related
Jul 25, 2006
Hello all,
I know I have seen this before and I have searched the forums several times and cannot find it now.
Maybe I am searching the wrong thing. Can someone point me in the right direction?
I need a button on my form that opens a subform or subforms when clicked.
How do I set this up?
Thanks,
Di
View 4 Replies
View Related
Aug 14, 2006
Hi all,
I have a form with a button on it, that when clicked it will open a subform on the same form. But, when I clicked this button, it gave me this error message:
The expression On Click you entered as the event property setting produced the following error: A problem occurred while [Database Name] was communicating with the OLE server or ActiveX Control
For more details on this error message, see the attached file.
Any attempt to help will be highly appreciated.
Sorry for bothering you.
View 2 Replies
View Related
Aug 29, 2006
I have a form with a combobox to select a clients name and that pulls up that client in a subform and shows various records for the client. But it always opens up showing the first record and I want it to open up showing a blank record for keying in more data i.e. after the last record.
Can you help at all on this?
many thanks
View 1 Replies
View Related
Dec 13, 2005
I want to open Outlook with the recipients name in the To: box by clicking on the email address held in a subform list field...
Any ideas?
Dave E
View 3 Replies
View Related
Mar 9, 2005
I'd like to thank everyone for all the help with a long project that is nearing completion.
I have a query by form where I would like there to be a button that the user could push that would take the values from the query that are in the subform and open them up as an Excel spreadsheet for further analysis. There is a function called analyze it with Excel in the Tools/Office options menu but it only works for the main form. I don't get all the values.
Is there some way I can open the subform as an Excel file or set the code and SQL string that it is based on to values for an Excel sheet?
Thanks
View 1 Replies
View Related