General :: Form With Subform Datasheet - Record Deleting
Aug 17, 2015
Currently i have a form with subform datasheet
Form from Purchase order table
Subform from serial table(Brand,Model,Type,Location,Serial) with serialtrans table(InOut,AQty,Comment)
(SELECT tbl_Serial.*, tbl_SerialTrans.*
FROM tbl_Serial LEFT JOIN tbl_SerialTrans ON tbl_Serial.SerialID = tbl_SerialTrans.SerialID
when i click on the datasheet row and delete the row it only delete the record from tbl_SerialTrans but record on tbl_Serial was not deleted
is there any way to delete it?
View Replies
ADVERTISEMENT
Dec 21, 2006
Hi, I have a problem I don't know how to solve it. I have a subform in datasheet view, linked to the main form. There is a running total on the main form based on a dsum on a field of the subform.
When I delete a row on the subform datasheet, the main form calculation is not automatically updated. I had to create a "update" button to do the refresh.
Is there a "on record delete" event available for a datasheet sub form?
Thank you for any help.
View 1 Replies
View Related
Aug 20, 2012
I already make textbox name: TbBanyak on subform footer with control source =sum([Jumlah])
I success display it on mainform with texbox control source =[Jualsubform].[Form]![TbBanyak]
how to enter/record the result to table record??
View 3 Replies
View Related
Sep 3, 2014
I have been trying to figure out how to make a form refresh after deleting a record in a subform. The code in the combo box that populates the subform works fine. If you select the "Action" of "sign" from the unbound combo box above the subform, it places "Sign" in the the subform and then makes a checkbox on the main form [WillTake] = True.
But when I delete the record by right clicking on the entry, the focus is sent back to the main form so I can refresh the form and thus update the [WillTake] checkbox. I have tried just about everything. I can get the focus to a field on the form, but I cannot figure out how to refresh or requery the form.
The code to transfer focus is on the OnDelete of the subform.
I have included a watered down version of the DB.
View 11 Replies
View Related
Jun 23, 2015
I have a navigation tab with 6 sections, of the 6, 5 of them are self-made split view with a form view on top and datasheet on bottom and upon adding records through a command button on form view I would like the datasheets to update.
On other forms it would (I believe) update to the bottom of the datasheet, now on the ones I've been banging my head against it either replaces the top record or doesn't show up unless I switch tabs and switch back. From my searches I assume this is in need of a requery...
View 14 Replies
View Related
Sep 30, 2013
The situation is i have two forms, looking at the same table, but the main table shows more records, I would like to select a record in the datasheet subform and have the main form flick through to the corresponding record.
View 5 Replies
View Related
Aug 24, 2012
I've got a main form with two lists boxes. I want to show the visible columns in my subform (which is a datasheet) in one listbox and show the hidden columns in the other. Also I want to allow the user to hide / show columns using right or left arrow buttons between the list boxes. My subform is bound to a stored procedure using ADO.
View 5 Replies
View Related
Jul 16, 2012
I have two forms. One is a datasheet. One is a form with a default view of Single Form (which contains combo boxes).I want to have the user select (click) on a record in the datasheet and have the second form open to that record. The datasheet form acts as an advanced search on two title fields.I tried the open form macro but I dont know how to have to second form open to a specific record.
View 9 Replies
View Related
Jul 6, 2006
Hello All,
I have an ordering db that utilyzes the typical Form / Subform layout. I
would like to be able to delete a record from the Main form and maintain the
same postion relative to the other records. For example, if I am scrolling
through the records and want to delete record #45, After I delete it I would
like to be able to have record #44 visible to the user.
I am currently using (2) SQL statements to delete the records from the main
Order table and the Order Details table which are linked without Cascade
Delete Related Records being on.
I had set-up a recordset procedure to try and find the bookmark set before
deletion but the only way I can get the sub-form to not show a blank form (no
controls visible for the record just deleted and the #deleted in controls on
the main form) is to requery after the delete, which loses the bookmark. If
i place the ReQuery at the end it displays the records properly, (without the
blank record) but returns the record to the first record. I have tried
turning off any sorting references to OrderBy, etc. but it still returns to
the first record.
I have also tried using "DoCmd.RunCommand acCmdDeleteRecord" but it doesn't delete the record from both tables.
Dim rst As Recordset
Dim strSearchName As String
Me.AllowDeletions = True
Me.sfmOrderDetails.Form.AllowDeletions = True
Set rst = Me.RecordsetClone
strSearchName = Str(Me.sfmOrderDetails.Form.txt_Order_No.Value)
rst.FindFirst "Order_No = " & strSearchName
CurrentDb.Execute "DELETE Order_ID FROM tblOrderDetails WHERE Order_ID = " &
Order_ID,dbFailOnError
CurrentDb.Execute "DELETE Order_ID FROM tblOrders WHERE Order_ID = " &
Order_ID, dbFailOnError
Me.Requery
Me.sfmOrderDetails.Form.Requery
Me.Bookmark = rst.Bookmark
Set rst = Nothing
Thanks!
View 6 Replies
View Related
Jan 10, 2006
Ok heres the situation, I have one form(frmBikes) that i use to filter the results in a subform(frmSubBikes). From the main form i have a button which opens another form(frmSell) which allows me to enter the sold price and when "cmdSell" is pressed many delete and append queries are run on the data stored in (frmSubBikes). When this button is pressd the deleted record has #deleted in each field where as it should be gone and i get this error message.
(The expression you entered refers to an object that is closed or does not exist)
What do i need to change? my minds been off this project for ages now ive got a brain block so help would be appreciated.
this is the code for "cmdSell"
If MsgBox("You are about to complte selling transaction: " & r & ". " & Chr(13) & " Is that correct ? ", vbQuestion + vbYesNo, " User Accounts") = vbYes Then
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SetWarnings False
DoCmd.OpenQuery "appSoldBikes", acNormal, acEdit
DoCmd.OpenQuery "UpdSoldBikes", acNormal, acEdit
DoCmd.OpenQuery "DelHires", acNormal, acEdit
DoCmd.OpenQuery "DelRepairs", acNormal, acEdit
DoCmd.OpenQuery "DelSoldBikes", acNormal, acEdit
DoCmd.Close
Me![frmSubBikes].Form.Filter = Searchstr
Me![frmSubBikes].Form.FilterOn = True
End If
Exit_cmdSave_Click:
Exit Sub
Hope you can help,
Thanks Sci
View 4 Replies
View Related
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
May 15, 2013
I have been handed an Access database (Access 2002-2003 file format) to clean up and update as necessary. Currently I am trying to add new rows to a datasheet that is in a subform. I have had no trouble in the past adding rows and for some reason now I can't.
In some instances I can update an existing row but never add a new one. Also, the records options are greyed out in the ribbon except for a select few that are not useful (refresh all, totals, more). Can't add new record from their either. I am in the main form that contins the subform which contains the datasheet, in form view.
View 5 Replies
View Related
Dec 23, 2013
How can I obtain the value of a record from my subform in datasheet view?
Ideally I could double click in the "cell", for lack of a better word, and grab that value to pass through to another function.
On double click event? What then?
Edit: I suppose the user could select the row that the value is in as well. As long as I could then find the field I need from within the row. That might make things easier.
Edit 2: Sometimes I post before doing proper research. I've figured it out. Here is a quick example. The below code references an unbound subform called "Main_AU" where the field I want is "Description". The MsgBox is used to confirm that the code is grabbing what I want it to.
Code:
Dim test As String
test = Main_AU!Description
MsgBox test
View 3 Replies
View Related
Nov 14, 2012
I have designed a datasheet in a subform and it has a nested datasheet inside of it. I have it all designed and now I want to disable the user from doing anything to either, such set column widths, set colours etc. How would I do that?
View 1 Replies
View Related
Jan 4, 2013
I have a subform in datasheet view and a button on the main form which is used to clear all filters in the subform.
The button's OnClick event calls a procedure on the subform. The procedure in the subform has the following code :
Code:
Me.filter = ""
Me.filterOn = false
Docmd.Save acform, subformName
Debug.Print "Filter : " & Me.filter
Me.requery
I also have debug print outs which shows the current filter on the forms OnLoad and OnClose events.
Everything works fine but somehow when I reopen the main form (with subform) the filter gets reset to the previous one.
I can change filters and that saves ok but if I clear filter it always returns to the previous ones when I reopen the form containing the subform...
For reference the filter string in subform looks like "(qrySubformQuerySource.Fieldname)="xx""
View 5 Replies
View Related
Nov 30, 2012
I am wanting to delete a record based on 2 criteria. ive had a look on the net and it looked so simple. I tried
PHP Code:
CurrentDb.Execute _ "DELETE FROM tblRecommendedProducts " & _ "WHERE ClientDetailsID = " & [Forms]![frmClientSale]![ClientDetailsID] And "WHERE ItemsID = " & [Forms]![frmClientSale-Retail]![ItemsID], dbFailOnError
View 14 Replies
View Related
Dec 2, 2014
In Access 2010, if you have a form with a subform in datasheet view, and you move the focus away from the subform, how can you tell which record(s) on the subform are selected?
When the subform has the focus, the selected row is shown with a blue/grey tint. But as soon as the subform loses the focus, this disappears and all rows look identical.
Its an issue as I have 2 datasheet subforms on my main form, with the 2nd showing records related to the record selected in the 1st. But as soon as the 2nd subform receives the focus, it is impossible to see which record in subform 1 was selected.
I have tried conditional formatting, but that does not work.
View 1 Replies
View Related
Sep 11, 2012
I have a subform that is in Datasheet view. If I open this subform on it's own, the Date Picker works for the Date field. However, if I open the main form with the subform on it, the date picker doesn't work? Nothing happens when I select a date on the calender.
I am using MS Access 2010.
View 1 Replies
View Related
Apr 27, 2006
Hopefully a quick one, this.
I have a form containing a subform, as a datasheet. The form displays the full details of whichever record I select in the subform.
When I click on a button to delete a record that I've selected in the subform, it vanishes and the subform row that displayed it is cleared. I have a figure displaying the total count of rows in the subform (thanks to Ghudson for that one) and this also reflects the change. the form, however, still displays the details it previously did.
As the last line in the code behind the button I have:
[Forms]![form name].Requery
however, when the code runs and hits this line, it displays a message that says
'Runtime Error 3167: Record is deleted'
Without this line, the form doesn't refresh (obviously) and I get no error messages, but when I next select any row in the subform I get a message:
'Record is Deleted'
and all the fields in the form display 'Deleted#'. Selecting another row fixes the problem.
It seems pretty clear that I'm not refreshing the form correctly, but in spite of searching the forum and finding a fair few threads on this topic I can't work out the syntax I should be using.
Hopefully, someone more knowledgable tham me can point me in the right direction.
View 1 Replies
View Related
Sep 18, 2014
Is there a way to have a datasheet open with the last record at the bottom of the page? I now have it opening to the last record, but it has the last record at the top and can't see the records before it without scrolling.
View 2 Replies
View Related
Sep 15, 2013
I have a mainform named EMA and a subform named Q_EMO. In the mainform there is one event related to a patient.In the subform Q_EMO there are all the events releted to the patient.I would like to get a record in the mainform EMA when I double click in the record of the subform.
View 12 Replies
View Related
May 15, 2013
When I highlight multiple records and choose delete, it only deletes 1 record.
Is it possible to delete more than one record at a time?
View 2 Replies
View Related
Dec 9, 2014
I have a main form with several linked by ID worksheet sub-forms. I would like to add a on-click function to delete the main form and all related record on each sub-form. I have tried several methods but nothing is working correctly. The cascading delete function is not available as part of the form relationships. How I can accomplish this?
View 1 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
Mar 15, 2006
Help needed! (Apologies if this is a stupid question !)
I'm making a database for my OCR A2 coursework.
I have a table set up for tenants, and have created a form through which the user can delete a record from that table.
I have a look up combo box, to select the record (tenant) for deletion, and a command button - using the wizard that came up I have selected "delete record" - but it doesnt work! It doesn't delete the record i have selected.
Why Is this not happening ? It also doesn't bring up a warning box saying "you are about to delete one record" or something similar?
Thanks xzxx
View 9 Replies
View Related
Oct 21, 2006
Well, I couldn't find this using the search, so here it goes:I have a form in which I enter data to create a new client. Within that form I have a subform in datasheetview which is based on a query which holds/retrieves certain (important) fields from a table that holds case info. So in that one view the client data is displayed on the form and all cases and the most important data from those cases is displayed nicely in one screen.Now, when a client calls I navigate to that client and see all previous and all current cases that are open and/or closed for this customer. So the customer says case this and that number is the case I need to discuss with you. Now, what I would like is to be able to click or double click anywhere on the line that, for instance, says case nr 55, so that the form(s) belonging to case nr 55 pop up and all info concerning that case is displayed and can be edited as needed. My problem is: I'm still a newbie and if it was a simple thing like using the on_click event to open the form that's needed, I would not have to post this question. But that can't be done (as far as I know) since the subform is based on a query which is displayed in dataview.Am I overlooking a very simple solution to this problem or is it really going to be as difficult as I think it's going to be?For clarification of the idea I have included a screenshot of the form in question. I assume there are tons of databases out there which use such a layout or idea as this one. Please, never mind the buttons etc. It is still a work in progress. ;)
View 12 Replies
View Related