Can someone tell me how I migh find a record in a main form based a a selection in my subform?
I have a Main form called frm_ProductionSchedule.
It contains three subforms: frm_ProductionSchedule_subform frm_ProductionSchedule2_subform frm_ProductionSchedule3_subform
I would like to be able to select a record within any of the subforms and have the main form display it. The main form is linked to a SQL server Table. The subform are based on queries. The unique PK field is a date field called record_date.
I should add that the Link Child/Master fields are blank for all Subforms. Each Subform is linked to a query and displays data for a particular machine (1,2 or 3) AND is updated based on a combo selection of the Production week. The queries for one subform would look something like this:
Hi, I think what I want to do is simple but I can't figure it out. I've tried searching the forum for the solution but I'm having trouble with what I've found. Here's what I'm trying to do: I'm composing a text string on one form (recipe ingredient) and, once it is complete, I want to add it to the records in a subform on a separate form (the recipe). The string composition works great, and I can use:
to paste the string into the textbox on the subform. The problem is "finishing" the record in the subform. When I prepare a new string for the next ingredient, it copies over the previous string. So, I'm not moving to a new record in the subform. I've tried:
but Access tells me the form isn't open, which isn't true.
So, what I want (I think) is a way to direct the subform to move to a new record before I paste in my text string. Or, to direct the subform to move to a new record after I paste in my text string.
By the way, the subform has a before insert event that copies in the record id of the recipe for the new record holding the inserted text string, so the table relationships will be fulfilled:
Private Sub Form_BeforeInsert(Cancel As Integer) Me!lngRecipeID = Me.Parent!lngRecipeID End Sub
I'm pretty sure I'm missing something simple here, and I really appreciate anybody's effort to help me get it right.
The main issue I'm having is trying to populate a text box based on a combo box selection. I've found threads on that - the twist that is throwing me for a loop is that I'm dealing with two different forms.
I have a main/welcome form with two combo boxes on it. Based on the user's selections in these two combo boxes, two different forms are opened for data entry. For instance, box 1 has A, B, C and box 2 has x, y, z. If a user chooses B and z, then form B and form z are opened. What I want is for a text box to be populated on one of the opened forms, not the same (main/welcome) form. In other words, when B and z are chosen, I would like there to be a textbox autofilled with "z" on form z.
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).
On a from ("Customers") with tabs I have on the second tab a subform ("Orders") as a single form with a field "Ordernumber". "Customers" and "Orders" are linked through "CustomerID".
On the mainform I have a "searchfield" in which a enter the Ordernumber, I want to find.I cannot manage it, that After_Update of the "searchfield" the ordernumber is found on the subform and the focus is on that subform.The focus only shows me the CustomerID on the first tab, but does not jump to the second tab exactly to thes searched ordernumber.
Code:
Private Sub searchfield_AfterUpdate() Dim rs As Recordset Me.CustomerID.SetFocus Set rs = Me.Orders.Form.RecordsetClone rs.FindFirst "ordernumber = " & Me.searchfield If Not rs.EOF Then Me.Orders.Form.Bookmark = rs.Bookmark End Sub
I'm trying to open a form with a subform from a separate form. I've never had any issue before, but all of the sudden, the subform doesn't seem to open immediately. I get the error
Code: Method 'Form' of object '_SubForm' failed.
After that, it opens (subform and all), but some calculated text fields just say "#Name?#" The only thing I did today was add a command button to that subform.
When I try opening the form (or subform) from the navigation pane, I get
Code: The expression On Current you entered as the event property setting produced the following error:
A problem occurred while Contracts was communicating with the OLE server or ActiveX Control
When I step through the code, it doesn't reach the On Current event.
I currently have a form to manage inventory. On the left side of the form, I have a list box that shows all of the items in the database and finds the record on the form based on the selection.
I would like to have toggle boxes or something underneath the list box that when clicked will sort the box by vendor and item and another that when clicked will sort the list by part number and then select the record on the form based on the selection at that time.
I have no idea how to accomplish this...can anyone help?
Then I created a form named MAINF with FLOWER_SHIPPING as its RecordSource. The form only has one TextBox: Date.
Then in MAINF, I created a subform named SUBF with FLOWER_SHIPPING as its RecordSource, in Datasheet View. It shows all fields in FLoWER_SHIPPING as it is.
The link between MAINF and SUBF is Date.
I want SUBF to only show record based on the Date chosen in Date TextBox in MAINF. So far, yes it did what I want. But with problems:
1) [SOLVED] SUBF does show record based on the Date I've chosen in MAINF's TextBox Date, but it ALWAYS ALSO shows the first record on the FLOWER_SHIPPING table. And the date in the first record always changed into the Date I just input in the TextBox Date in the MAINF. Automatically.
Example: I chose 6/22/2013, and there are 2 records with that date. the SUBF will show 3 records: those 2 records + the first row of FLOWER_SHIPPING with its Date automatically set to 6/22/2013.
2) When I chose a date in MAINF, I have to click everywhere in the SUBF so that it will refresh its content. Can I have it refresh automatically everytime after a date chosen?
i have a subform name(SUBSAL)in this subform i get reocrds for some employee as select combobox Name(CMBEMP).some employee having 2 record or some having 6 record as their transaction
i have sum of transaction at subform footer field but when only 2 records shows in subform it shows a major gap or blank space in subform detail section.
I would like to be able to switch between these two forms and the form automatically set focus to the record that I was on the form prior. Meaning if I am on record 3 on Form A and navigate to Form B, I would like to automatically set focus to record 3. Is this possible?
A possible issue after this gets sorted out is what happens if with the same scenario above record 3 does not exits? is it possible in that instance to simply requery the form?
I have a database which has a main form and subform built in linked by parent/child customerid, what i would like to do is search all the subform records from the whole DB and return its parent record on the main form?
Can this be done? because if i use find it will only search the filtered form i have onload of the form?
I have a form called frm_Incident_Single. On this form I have a subform/subreport called tbl_Incident_Apps_subform. I have a command button on frm_Incident_Single that opens another form called frm_Incident_Apps where I choose multiple selections. When I save or close the form I would like to update the subform - tbl_Incident_Apps_subform.
I've tried to requery/refresh the subform in the save procedures in frm_Incident_Apps but when I save it, I get a syntax error. Here is the line of code:
I have a combo box that displays LastName FirstName.
If I have two people with the same lastname it finds the first one in the table w/ that last name. Please help with my code so it searches by firstname and last name. Thanks in advance.
Kacy
' Find the record that matches the control. Me.RecordsetClone.FindFirst "[Contact_LastName] = '" & Me![cboContact] & "'" Me.Bookmark = Me.RecordsetClone.Bookmark
I have a modal form which has a single record which is then linked to a sub-form on the same modal form. This all works fine and shows the relevant record and sub records but I want the modal form main record to change dependant on the record selected in the subform (which is basically order item history.
I found some code on another site which seemed to work for others but for me I am getting Run-time error 2465 and it doesn't like my reference to 'Me' - is this because it is a modal form?The code I am using is:
Public Function GotoRecord(RecordID As Long) Dim rst As DAO.Recordset Dim strCriteria As String Set rst = Me.RecordsetClone strCriteria = "ID = " & RecordID rst.FindFirst strCriteria If rst.NoMatch = False Then Me.Bookmark = rst.Bookmark
I have a search form with 1 combo box and a button which when the user inputs an invoice number and clicks the button, a main form is opened for that particular record.
The problem I have is to display an error message before the main form opens if the user has either left the combo box blank or they have input an invoice number that doesn't exist.
I got this function which is supposed to find a record based on the primary key, and then give three fields a value if they should be empty.
Public Function DoesXrefExist(faPersonID As Long, faRoleCode As String, faDorpID As Long, faDorpCode As String) If (DLookup("PersonID", "PEOPLE", "PersonID =" & faPersonID) > 0) Then End Function
Thats as far as i have got...for the next part.I get the feeling that i need to use the recordset object that exists somewhere.How do i access that recordset object? I have not been using any DAO or ADO, just straight VBA. I know i can create recordsets and stuff using DAO/ADO, but there must be a recordset that has been created already by the Dlookup command...
When I add a record in the subform and then move to the next record whilst still in the subform, the main form jumps back to its first record? I then have to move back to the right record in the main form to update the next record in the subform.
I want to move to the next record in the subform without affecting the main form.
I have a form for accounts, which has a subform listing the customers within each account.
On the customers form I can use the wizard to add a combo to find a record, but if I want to add a similar combo within the subform, the option does not appear in the combo wizard.
Can anyone enlighten me on why/how to resolve?
Many thanks
Mark
(using Access 2003 on an Access 2000 format db, Win XP Pro SP1)
I have form where I will show the details of one table(member details table). In same form I have subform where I can get the member family details (here I am using the relationship table), now my problem is when Member detail form open based on the member id, the below subform data should be fetched...
I have a form with 22 subforms (in about 11 tabs). Each one of these subforms has a controlling field in the main form (table) that dictates if the associated subform needs to comply with data entry rules or not.
For example: Field in main form cboMed (Yes; No) Subform: frmSubMeds has a list of medications
I want to be able to loop through all the records of the subform and determine if they are complete.
This check is run from a command button; that should also consider the value in the combo box. i.e. Check only if the combo has a value of "Yes"
Since i have 22 subforms and have to run the check on everyone of them, i have used the tag property to check if the record is blank or not. This is what i have so far
Code: For Each ctl In Me.Controls Select Case ctl.Properties("ControlType") Case acSubform ' only look for subforms If ctl.Enabled Then If Not (IsNull(ctl.Properties("SourceObject"))) Then 'if it is a subform type
[Code] ....
The problem with this is that it only looks for the selected record in the subform and doesnt look for ALL the records.
i'm creating a database which holds all animals. i'm trying to make the parents selectable in a subform based on the same table as the main form - this doesn't work for whatever reason ("table is already opened exclusively by another user,..."). it can't just be one field or a query, it needs to be a subform because besides name and eartag i also want to display a small picture of the parent and only the filename is being stored.
i'd really like it to be selectable records in a continuous subform, so the risk of selecting a wrong id is minimized. is there a way around this not being able to use the same table for a subform?