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 Replies
ADVERTISEMENT
Oct 23, 2013
I'm using Dmax() to return a max number in a field which I then want to inc by 1 for a new record. Dmax is returning 999. I believe Dmax therefore thinks it's a text field. So where do I change this to a number field?
View 2 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
Aug 15, 2007
Having problems with the following function to goto a specific record and return a value from a field in that record.
Code:'Public Function intFieldZConv(strICAO As String) As IntegerPrivate Function intFieldZConv() As Integer 'TEST PURPOSE ONLYDim strICAO As String 'TEST PURPOSE ONLYstrICAO = "KTCM" 'TEST PURPOSE ONLYDim cnCurrent As ADODB.ConnectionDim rsFieldInfo As ADODB.RecordsetSet cnCurrent = CurrentProject.ConnectionSet rsFieldInfo = New ADODB.RecordsetrsFieldInfo.Open "tblFieldInfo", cnCurrent, , , adCmdTable'rsFieldInfo.Index = "FieldICAO"'rsFieldInfo.Seek "=", strICAOintFieldZConv = rsFieldInfo!FieldZConvSTMsgBox intFieldZConv 'TEST PURPOSE ONLYrsFieldInfo.ClosecnCurrent.CloseSet rsFieldInfo = NothingSet cnCurrent = NothingEnd Function
strICAO is received from another function which is to be used to determine the specific record in the table "tblFieldInfo". Once that record is referenced, the value from the field "FieldZConVST" is returned.
My problem area is highlighed (index and seek) which I receive an error stating "method or data member not found". Any help would be appreciated on how to finding a specific record.
Thanks
Jeff
View 6 Replies
View Related
Jul 27, 2004
I'm having difficulty controlling data entry to (disabling) a subform when a new record is being added to the parent form. I can set the subform to be disabled if there is no index value in the parent form (this allows the subform to function for existing records) but then the user has to create the parent record and move off of that record and then return to it in order to add child records to the subform. This is basically a create new records/data entry problem and I'm feeling pretty stupid. There must be a way to handle this...
View 3 Replies
View Related
Jun 5, 2015
I want to force an autonumber field on a parent form to start a new record when clicking on a subform, so that value can be passed to new records in the subform. Is there a simple way to do this?
I'm using Access 2010. I have a parent form based on a query that does not have any fields intended for input but has an autonumber ID field. The subform is based on a query that finds records based on the ID field in the parent. When the parent ID field has a value it works perfectly, including adding new records in the subform. When the parent ID field is blank, though, I can add new records in the subform but the ID field does not populate.
I made a workaround by adding a Yes/No field to the parent and its query that users can click to create a new record, so the ID field has a value to pass to the subform. This works fine, but I feel like there should be a better way to do this without user clicks.
Via VBA, I've tried setting the parent form to dirty, and setting the Yes/No field to Yes, along with a variety of less likely candidates like refreshing and requerying. I've tried the above on various events including the parent LostFocus; the subform Got Focus, On Click, On Mouse Move; and the same events for control on the subform.
At this point I'm not sure whether the problem is my event choice, or the object method I'm using, or just the syntax for my control references. Or maybe this is actually more complicated than I think and sticking with the checkbox option is the best way to go.
View 6 Replies
View Related
Dec 10, 2013
I have two subforms on a "Page"/Tabs. Subform #1 is a continuous form which accepts data about dimensions of a pattern piece. The other subform needs to update its information display each time the last control of the first subform loses focus, because it tells me how much material is required for all pieces of this pattern that are entered.
My first feeble attempt at this was to add the following code to the "Lost Focus" event of the final control on the first subform:
Form.Parent.Refresh
This succeeded in forcing the second subform to re-run its calculation.
However, after the recalculation took place, I wasn't able to move to the next record on the first subform. This subform is a continuous form, and I need to be able to add another row of data and then see the second subform change based on the additional information in the first subform.
Obviously I've done this wrong.
View 1 Replies
View Related
May 24, 2014
I have a form and a subform in it. I added New cancel button in the form so that the the user can cancel the record creation and no record will be inserted in the parent table.
But when details are entered in the subform (a datasheet) row records will be created in the subform table. what is the correct method or how to cancel these records if the user choose to click cancel button on the parent form.
View 5 Replies
View Related
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
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 3 Replies
View Related
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
Jul 9, 2014
I have developped a table and some forms reated to that.Since the main survey is quite long, I developed 4 forms to enter the data. Now I have a question related to data entry.Suppose I start entering data for one record and I decide not to fill up all the 4 forms, I simply decide to go back to it later. How can I go to the same record and keep entering the data from where I left?
If I am in Datasheet view, I can easily use the Find option to look for the record. However, I dont seem to be able to understand how I can open the form of that record to enter the remaining data.
View 14 Replies
View Related
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
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
Nov 16, 2014
I have the following script which updates fields in a table.What I am after is a msgbox script to list the ID field value once it is updated.
Code:
Set rec = dbs.OpenRecordset("Select * from Stk_Merge_Delete_Register")
rec.AddNew
rec("StkItemID") = [Forms]![MergeItem]![txtStkFrom]
rec("RackID") = [Forms]![MergeItem]![txtRackFrom]
[code]....
View 3 Replies
View Related
Jun 22, 2015
is there a way to find out who has a record open and send him message or someting similar?It happens from time to time that some one has a record open (selected in a form) and then is doing other things while the record is locked and a second person can't do nothing to the record.
View 14 Replies
View Related
Aug 23, 2012
I have a form [Invoice] with a subform [Orderssubform1] in it and they are both linked with the field 'CustomerID' using a parent and child relationship. I have also established that relationship in the tables too. Using a combo box [Combo0], the user can select a customer from the form and then enter details about the invoice in the subform. They then click 'Generate Invoice' and it creates a report for them. This all works fine.
The problem arises when I want the customer to locate a certain invoice using a button. I would like the customer to be able to click a button on the form which would then bring up a box asking them to enter the invoice number [InvoiceNo] and it would then locate that invoice so they can generate it as a report again. The user can find the customer themselves using the combo box, I just want the record related to that customer to be found using the button.
View 14 Replies
View Related
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
Jul 8, 2013
how to deal with errors specifically with error "The Microsoft Access database engine cannot find a record in table".Database which I'm creating have table Products, which contains information about products. Most important information in this table is if product is VATable or not. I decided to define product names in invoice table that database can recognize products and calculate VAT in invoices if product is VATable. Problem starts if you have new product. When I add new product in invoice it counts VAT but when i go to next record I receive message mentioned above. It doesn't allows me to go to next record or save record.
I was wondering is it possible to make it that access allows to fill invoice, informs about new products only when i have finished adding all products in invoice and than gives opportunity to add them to product list?
View 1 Replies
View Related
Jan 29, 2014
Code:
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("Complaint", dbOpenDynaset)
[Code] ....
I find the record, and then try to update a field. The drop down menu field gets updated after it is initially changed from blank to a value, but it never changes after that though the re!C02 field has the correct newer data when I change it again.
View 14 Replies
View Related
Jun 27, 2012
I added a text box on my main form. I have to other parent names in a subform that I would like to add to my main form. I have this working just using one parent name "dtdrec" that is working. How would I add "flduser" and "fldstuff".
=[tblPayEstimates Subform].[Form]![dtdrec]
View 7 Replies
View Related
Jul 18, 2015
Is there a way to write a code or query to find the last value in the last Field (column) of a record in a table?
Or find the last field name that contains data, in a record?
View 5 Replies
View Related
Jun 6, 2014
I have a table called login and inside that table is three columns: username, password and admin.
I have the username saved in a global variable called GsUser. How can i find the record in that table with the same Username as the string stored in GsUser and use that record for an if statement which sees if the value of the admin column is "Yes". Im trying to do it using VBA. Im not using a form where everything is bounded.
View 2 Replies
View Related
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
Jul 11, 2015
If I have four date Fields in a query, Astart, Bstart, Cstart, and Dstart and want to have a calculated field to find the latest date for each record how would I do that? I have tried things like:
LatestDate: MAX(Astart, Bstart, Cstart, Dstart).
View 2 Replies
View Related
Aug 11, 2005
Well, my newbie status in db development has reared its head. I knew from the beginning I didn't want to have cascade delete when deleting a clinic (parent) from the db. Problem is some queries in other areas need some clinic info and if the clinic is deleted, it won't be available. Right now I'm thinking that an easy way out is only allowing a delete if it has no attached records. If the clinic is no longer used, they can just write in the memo field that this clinic is no longer used. It's not a large db and there won't be hundreds of clinics so it may not be too bad. Any other suggestions?
scratch
View 6 Replies
View Related