Forms :: Find A Record On A Subform

Feb 14, 2015

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

View Replies


ADVERTISEMENT

Forms :: Listbox On Subform To Find Record?

Dec 20, 2013

Is it possible to put a listbox on a subform where it will allow you to find a record on the subform? The wizzard dosen't sem to allow me to do it!

View 5 Replies View Related

Forms :: Find A Subform Record From A Separate Pop-up Form Based On Its ContractID?

Apr 24, 2014

I'm trying to find a subform record from a separate pop-up form based on its ContractID. When I click the button, I get the following error:

"A macro set to one of the current field's properties failed because of an error in a FindRecord action argument."

When I step through the code, it works just fine. Here is my code:

Code:
'Find contract
With Forms!frmContractForm.frmContractSub
.Form.ContractID.Enabled = True
.SetFocus
.Form.ContractID.SetFocus
DoCmd.FindRecord Me.ContractID
.Form.Business.SetFocus
.Form.ContractID.Enabled = False
End With

View 1 Replies View Related

General :: Find Record From Field In Subform And Then Return Its Parent Record

Feb 6, 2014

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?

My onload event is based on fosusername()

View 3 Replies View Related

Find A Record Combo On A Subform

Sep 11, 2006

Hi all,

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)

View 1 Replies View Related

Modules & VBA :: Find Record In A Subform / Getting A Runtime Error 438?

Feb 26, 2015

I have an unbound form: frm_ReceiptSearch with some fields that, when something is input, will search a datasheet viewed form on a subform on the main form (subform name is sf_frm_Receipts). Currently, on the txt_CheckNo field's after update event, I have the following code:

Private Sub txt_CheckNo_AfterUpdate()
Dim SrchVar As String
SrchVar = Me.txt_CheckNo
Me!sf_frm_Receipts!REFNO.SetFocus
DoCmd.FindRecord SrchVar, acEntire, , acSearchAll, , acCurrent, True
End Sub

but I'm getting a runtime error 438.

View 4 Replies View Related

Find Record In Main Form Based On Selection In Subform

Nov 8, 2004

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:

SELECT dbo_tbl_ProdSchedule.PartType, dbo_tbl_ProdSchedule.PartNumber, dbo_tbl_ProdSchedule.Work_order_no, dbo_tbl_ProdSchedule.FrameType, dbo_tbl_ProdSchedule.FrameNumber, dbo_tbl_ProdSchedule.Shift, dbo_tbl_ProdSchedule.Sch1_date, dbo_tbl_ProdSchedule.Sch1_spins, dbo_tbl_ProdSchedule.Sch1_sheets, dbo_tbl_ProdSchedule.Sch2_spins, dbo_tbl_ProdSchedule.Sch2_sheets, dbo_tbl_ProdSchedule.Sch3_spins, dbo_tbl_ProdSchedule.Sch3_sheets, dbo_tbl_ProdSchedule.Sch4_spins, dbo_tbl_ProdSchedule.Sch4_sheets, dbo_tbl_ProdSchedule.Sch5_spins, dbo_tbl_ProdSchedule.Sch5_sheets, dbo_tbl_ProdSchedule.Sch6_spins, dbo_tbl_ProdSchedule.Sch6_sheets, dbo_tbl_ProdSchedule.Sch7_spins, dbo_tbl_ProdSchedule.Sch7_sheets, dbo_tbl_ProdSchedule.Frames_due_date, dbo_tbl_ProdSchedule.Comments, dbo_tbl_ProdSchedule.Record_date
FROM dbo_tbl_ProdSchedule
WHERE (((dbo_tbl_ProdSchedule.Sch1_date)=[Forms]![frm_ProductionSchedule]![cmbSchDisDate]) AND ((dbo_tbl_ProdSchedule.SpinCoaterNo)=1));

AND WHERE ((dbo_tbl_ProdSchedule.SpinCoaterNo)=2)), etc. Respectively for each subform.

Thanks in Advance!!

John

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

Forms :: 2450 Error Message - Database Can't Find Subform

Jul 10, 2014

I built a form—frmDataEntry—whose Record Source is a query called qryEvent, which contains various fields from tblEvent. The primary key field is called EventID.

I also build a subform—sfmDataEntry—whose Record Source is a query called qryEventImages, which contains various fields from tblItem. One of those fields is ItemEventLink, which links records from tblItem to the EventID field in tblEvent. There is also an image box in this subform: filling in the field ImageFile with an image name (example: Logo.jpg) causes that image to display in the image box.

I’ve inserted the subform into the form using the Subform Wizard. Now I’m getting an error message that says "2450: Microsoft Access cannot find the reference form ‘sfmDataEntry’." Why this is popping up. The Link Master Fields and Link Child Fields sections of the property sheet are filled in correctly. Moreover, the subform records are still appearing, but the images linked to each record aren’t loading.

View 8 Replies View Related

Forms :: Find A Record Using TextBox And Button

Feb 2, 2014

Basically I want to type the ID(key) of a record table in a unbound text box and then by pressing a command button to be able to bring up that record (in form view). I do not want to use a combo-box.

So what do i write as VB code in the Private Sub mybutton_Click()

Table name is [ACTION_ID], ID field name is [ACT_ID] & text box name is [TEXT_BOX]

View 3 Replies View Related

Forms :: Button To Find Random Record

Jun 10, 2013

How to create a button on my form that would find a random record. I would imagine I will be doing this through VB...

View 14 Replies View Related

Forms :: MS Office Access DB Can't Find A Record

Jan 29, 2014

I have a main form (unbound) and a main form (bound) and then a subform (or a main form;subform;subform).The main form has the following SQL;-

SELECT Detail.*, Hazards.*, HowHarmed.*, Section.*
FROM PSR RIGHT JOIN (Hazards INNER JOIN ([Section] INNER JOIN (HowHarmed INNER JOIN Detail ON HowHarmed.ID = Detail.HowHarmedID) ON Section.ID = Detail.[Subject Area]) ON Hazards.ID = Section.detailID) ON PSR.ID = Detail.PSR;

This form appears to work fine. Essentially, there is a control on the unbound form whereby the user selects the section and it populates the respective form with the various 'detail' of the various records.My tables are as follows;-

Risk Assessments
Detail
Section
HowHarmed
Hazards
PSR
PLR
Staff

In the subform there are records from Riskassessments, which is the table in the source property of this subform (and not on the main form) with a link to PSR of which is on the mainform. Again, these appear to work if the record is entered via the tables - all the tables appear to be linked correctly from their respective dropdowns (+ sign) but when I go to add a new record in this subform, I get the error "The link masterfields property has produced this error: 'The object doesn't contain the automation object ID'." When I try to update from this entry the following message is presented;-"The ms Office access database engine cannot find a record in the table 'Detail' with key matching field(s) 'DetailID'.

The SQL for this subform is as follows;-

SELECT Detail.*, PLR.*, RiskAssessments.*
FROM (Detail INNER JOIN RiskAssessments ON Detail.ID = RiskAssessments.DetailID) LEFT JOIN PLR ON RiskAssessments.PLR = PLR.ID;

View 5 Replies View Related

Forms :: Find Current Record When Moving From One Form To Another

Aug 7, 2013

Lets say,

Form A has fields: ID, LN and FN

ID LN FN
1 A F
2 B G
3 C H
4 D I
5 E J

Form B has fields: ID, LN and TR

ID LN TR
1 A Y
2 B N
3 C Y
4 D Y
5 E N

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?

View 11 Replies View Related

Forms :: Find And Update A Record Using Multiple Criteria

May 30, 2015

I Have a forms which brings up a record in textboxes when you hit a search Button using a value that you type into a Textbox called BarTxt. My problem is that this value may not be unique. Therefore I'm trying to find and update the table using 2 values from the table (Barcode and PurchaseOrder).I have entered the code

Code:

Private Sub SearchBtn_Click()
PNTxt = DLookup("PartNumber", "BookInTable", "BarCode ='" & [BarTxt] & "'" And "PurchaseOrder ='" & [POTxt] & "'")
End Sub

This however is just bringing up a Type mismatch error. Even though both are text fields.Also even if I just use Barcode to search which works. My update Code

Code:

DoCmd.RunSQL "Update BookInTable SET DateBookedOut = '" & Me!DateTxt & "' WHERE BarCode ='" & [BarTxt] & "'" AND PurchaseOrder ='" & [POTxt] &

I get an Compile error saying "expected expression".

View 3 Replies View Related

Forms :: Find Record By Multi Field Primary Key

Jul 31, 2014

I have a form that has a FIND button. I want the user to enter the 3 fields that make up the primary key, then find the associated record. How can I do this in Access - not VBA?

View 1 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 :: Find Record In Table That Matches Textbox Input

Jan 5, 2014

I'm trying to build a search form.- Access 2007

I have a table (Table1), contains a 'part' field.

I wan to build a form with a blank text box (txtbx1) where users can enter a part description, this will search records in Table1>part and return a list of parts that match the textbox input.

Here's what I've done -

txtbx1 - property sheet - control source - part
event - on enter - ...

I've built an expression -

[Table1]![part] = [txtbx1]

hoping that this would match records 1n Table1 to txtbx1

View 10 Replies View Related

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 10 Replies View Related

Forms :: Main Form Jumps Back To 1st Record When Moving To Next Record In Subform?

Mar 24, 2015

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.

View 1 Replies View Related

Forms :: Select Record From Combobox List And Have Record Populate In Subform

Sep 16, 2013

I would like to select a record from my combobox dropdown list and have that record populate in my subform. Currently, I am only able to select the 1st record at the top of the dropdown list to appear in my subform. But I would like to select any record from the dropdown list and have it populate my subform.

View 8 Replies View Related

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 :: Saving New Record When Moving To Another Record In Same Subform

Jan 17, 2014

I have a subform with records of call details (date, time, subject) - the date and time are autogenerated and subject is a text field. After entering text in the subject field and then clicking on the close button in the main form, or clicking anywhere else in the main form, the record is saved to the table. However, if I enter text in the subject field and then move up to view previous records (within the subform) and then click the close button in the main form the record is not saved in the table. How can I either save the record before allowing the user to move to another record within the subform or before exiting the subform set the focus to the new record so that it will be saved on exit?

View 4 Replies View Related

Forms :: Subform Won't Allow To Add A New Record

Feb 13, 2014

I have a Demographics form with a Contacts subform.

They match with two tables: Demographics and a child table, Contacts.

If it matters, all the tables are linked to a back end database.

When I go to enter a new record on the Contacts subform, it "redirects" me to the first record.

Update: If I go to the datasheet view, the subform just continuously flashes...

View 2 Replies View Related

Forms :: Adding New Record To Subform?

Jul 4, 2013

I have a form with a subform (in continuous) I have on the main form a few unbound text boxes which once im happy with the results i press a command button on mainform which adds the unbound text boxes to a new record on subform im struggling with this one. I have done similar before but that was with the unbound text boxes in header of the actual form i was adding record too.

View 3 Replies View Related

Forms :: Continuous Subform - Last Record

Sep 14, 2014

I have a main form with a subform in continuous format. The subform displays the list of records and has a delete key allowing the user to delete that line (record) All works except if the user clicks the delete button on the new record line. Then there is an error message. Rather than use error trapping I would like to code a message OR simply beep to confirm nothing was done OR have the delete button disabled until something is entered into the record. The records do have a autonumber which I have in a hidden text box. I tried the following and even though the code shows that LineID does in fact = Null the code does not fire.

If Me.LineID = Null Then
DoCmd.Beep
Exit Sub
End If

View 4 Replies View Related

Forms :: Subform Needs To Open On First Record

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







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