Deleting Records PopUp Form
Mar 17, 2005
Hi All.
Is there a way show my own popup form instead of the standard "You are about to delete 1 record(s)" when deleting a record?
I have taken a look round and couldn't see that this was posted already......but apologies if it has already.
Frank. :confused:
View Replies
ADVERTISEMENT
Jan 21, 2014
I have a popup form that user will select for updating 4 fields in table. I have a update button that has code behind it that verifies the record is complete before closing the popup form. That works well.
However, I want to add an abort button that will close the form and save nothing entered however, I getting incomplete records and blank records. How can I code the button to not update the table and just close the form?
View 2 Replies
View Related
Mar 23, 2006
Hi There,
I have a form with a search field for an unique field, that looks up records in the table that belong to that unique field. See Code:
Private Sub cboLastName1_AfterUpdate()
On Error Resume Next
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String
cboLastName1.SetFocus
If cboLastName1.Value > 0 Then
strSQL = "SELECT * FROM tbl24HRPolicies WHERE AutoNumber = " & cboLastName1.Value
Set db = CurrentDb
Set rs = db.OpenRecordset(strSQL)
If Not rs.BOF Then
Me.ID = rs("AutoNumber")
Me.Prefix = rs("PolicyNumber")
Me.FirstName = rs("DateReceived")
Me.MiddleName = rs("Comments")
Me.LastName = rs("ClientsName")
Me.Suffix = rs("ShopID")
Me.NickName = rs("Nickname")
Me.Title = rs("ActivePolicy")
End If
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
End If
The fields, that take content based on that search field, are unbound.
I've added the delete button, but it's not working, because they are unbound. Is there no way to delete records with this form??
View 1 Replies
View Related
Mar 11, 2008
What code do I need to delete a record using a form and a combo box. I need to be able to link the selection in the combo box to a button that, when pressed, will delete the selected record.
Information:
Account Executive Combo Box - select an account executive based on a table (that contains only account executives and an autonumber)
Table name: AccountExecutives
Form name: DeleteAccountExecutive
Combo Box name: Combo300
Button name: DeleteExecutive
View 1 Replies
View Related
Oct 12, 2014
I have a form linked to a table and in my form there is a listbox reflecting the records in my table. Evereytime I tick a record in the list box the information on its corresponding columns appears on the text field.
So far I am able to add, modify and save record to my table using this form but I am having a problem on deleting a record which I selected on the listbox. I created a delete command button but it is not working. Please see attached database.
View 2 Replies
View Related
Nov 14, 2014
I have a FrmCadastro which updates my master table TblCadastro. Primary key of the TblCadastro is an auto numbered field named CADID.Fields CPF, NAME, FIN, NAT, TIP, MOT, and INSTREQ of the FrmCadastro are mandatory. My rule is that If any of these fields is null then the record cannot be saved (cannot be added into TblCadastro).
FrmCadastro has two distinct buttons, as follows: BtSave (to save either newly included record or changed record) and BtDelete (to delete a chosen record from my master table).To delete a record has not been a problem because under the click event of the BtDelete I use the following command lines to successfully eliminate an existing record (previously saved) from the TblCadastro:Dim numRecord As Integer
numRecord = Me.CADID
Dim SQL As String
DoCmd.SetWarnings False
SQL = "DELETE * FROM tblcadastro WHERE cadid = " & numRecord
DoCmd.RunSQL SQL
DoCmd.SetWarnings True
To save a complete record (properly filled in) has not been a problem either since the code takes care of that very well.When the user is in the process of adding a new record through the FrmCadastro two different user behaviors can take place:
1. Irregular entering - The user for some reason just give up saving the record (he decides to add the new record later, for instance) by selecting the option Save = No, or
2. Incomplete record - By mistake the user try to save an incomplete record (a record that shows any mandatory field as null).
I coded the following command lines under the click event of the BtSave to take care of deleting those records... BUT it does NOT work. The system reads each line of the code, find the record properly, close the form as expected, but the incomplete record STILL REMAINS in the TblCadastro. I do not understand why, since the code is pretty much the same of the one in the BtDelete.
Code:
Private Sub bt_save_Click()
If MsgBox("The record was changed. Do you want to save it?", vbQuestion + vbYesNo, Me.Caption) = vbYes Then
If MsgBox("WARNING! Incomplete record will be automatically deleted from database. If you did not fill in the fields CPF, NAME, FIN, NAT, TIP, MOT, and INSTREQ, the record will not be saved.", vbOKOnly, Me.Caption) Then
If Not IsNull(CPF) And Not IsNull(Name) And Not IsNull(FIN) And Not IsNull(NAT) And Not IsNull(TIP) And Not IsNull(MOT) And Not IsNull(INSTREQ) Then
[code]...
What should I code to exclude both the incomplete record and irregular entering thru the button Save (options Yes and No) ?
View 14 Replies
View Related
Apr 12, 2008
I have two tables.
1. Persons (list of persons)
2. Job history (list of jobs)
each person have their own job history. all these jobs are stored in the job history table. when i delete a person i would like the job history for this person deleted as well. each job stored in the job table have a field with person name, so that it is linked to this person.
how can i do this? vba or simple properties options?
- Roy
View 1 Replies
View Related
Feb 10, 2006
I have a database that holds hardware data. It's working fine, but there's a slight itch I'd like to scratch and I'm not sure how.
Very simply, I have a table listing printers. I have a search form with combo boxes called 'cboRoom' and 'cboDepartment'. The room and department fields in the printers table are lookups to a room table and a departments table respectivley.
The search form works fine by using the combo boxes to select a room and/or department, click search, and a query is run using the combo box selections as parameters. The query is also made to show all records if the combo boxes contain null. A form is then displayed with the query results.
Say for example, we have a room called B24. If B24 is selected in the combo box and the query run, I want a popup to appear that says 'No data with these search parameters' if there are no records containing 'B24'.
The search button (which is actually a label for design reasons) on the search form currently does nothing more than this;
Private Sub lblSearch_Click()
DoCmd.OpenForm "frmPrinters", acNormal
DoCmd.Close acForm, "frmPrinterSearch"
End Sub
'frmPrinters' is obviously using the query (qryPrinterSearch) as its recordsource. Obviously, the popup needs to appear as soon as the query has been run, but I'm not sure what code to use or where to put it...
I know I need some sort of (pseudo)
If frmPrinters.cboRooms Is Null
MsgBox "No Data"
Close frmPrinters
Open frmPrinterSearch
End If
Something like that. But obviously I need to do it for both cboRooms and cboDepartments, after the form has attempted to populate itself with data from the query (otherwise it return null values anyway I guess).
Any help with the code and where to put it much appreciated.
Regards,
Steve Swallow
View 3 Replies
View Related
Aug 4, 2005
I have two tables (same data but slightly different attribute structure) with a one-to-one relationship (the join field is "ID"). There are 69 matching records in these tables. How can I delete these matching records from table A, while leaving them alone in table B?
I'm confused because I brought both tables into a select query, created a join from ID to ID (within in the query's design view), and then added all fields from table A to the query. I then ran the select query and saw the 69 records from table A in the query's data view that I wanted to delete, highlighted all records and clicked delete. However, this action deleted the 69 matching records from TABLE B, not Table A!!! How is this possible? What should I do instead? Thanks.
View 3 Replies
View Related
Nov 11, 2005
A strange request but I hope someone can help with this one
I have a table (tbl_Econ) where I have to delete a specified number of records from a table. It does not matter which records as long as I delete the exact number
e.g On a form text box I enter the number or records to be deleted (e.g.6000).
The table (tbl_Econ) has 8000 records, so I have to delete 6000 records. I need to be able to do this automatically :eek:
View 1 Replies
View Related
Feb 1, 2006
How can I go about deleting records fully? So that there autonumber, etc can be used again without access moaning.
Thanks :D
View 1 Replies
View Related
Mar 14, 2006
I have a query (Query1) which returns results In one field recordID.
How do I delete records in a table where the RecordID is in the list Query1.recordID?
Thanks
View 4 Replies
View Related
Jan 25, 2008
Hi,
how would i go about deleting a set of records? i can get a list of records together in a query taken from 4 tables and would need to, if necessary, delete a single line. not all information needs to be deleted from all 4 tables though? the info to be deleted would only be deleted from 1 or 2 tables being the last 2 in the relationship.
i guessed it might be an append query but im not too familiar with them.
any chance of a possible suggestion?
many thanks,
NS
View 2 Replies
View Related
Oct 17, 2007
I am having trouble with my autonumbers when i have to delete a record.
Can anyone help me out with auto numbers?
View 9 Replies
View Related
Dec 14, 2006
Hi there, i have a master reset to delete all the data in the database. Although, as there is a username and password entry to get into the admin module, i wish for one entry in the table participantTable to not get deleted (to save one password/username so its possible to log into the admin module after the reset). The code below will delete everything, how can i change it so it keeps the first record in the table, and then deletes all the other records after.
DoCmd.RunSQL "DELETE * from participantTable"
Thanks in advance
View 1 Replies
View Related
Jul 23, 2014
So I created a new form that multiple coworkers will have access to. I understand that you can password protect an entire data base, but I was wondering if you could go deeper than that. I have a main form with a combo box (query to show existing IDs) for "ClientID" that links the main form and subform (Its controlsource is ClientID from the table the subform was created off of). If a user selects an existing ClientID, the linked subform pops up with the selected ClientID displayed on the subform in a field along with existing additional information displayed. If The user types in an ID not in the database, a blank subform comes up for the coworker to create this new record and the field for ClientID is blank.
1) How can I make it so that when a coworker types in a ClientID in the combobox that is not in the database, the blank subform that pops up has the ClientID field filled out with what was typed in the main form.
2) Situation: Adding a new client to the main form, and filling out the additional in on the popup subform. I want there to be a field on the main form for "worker". The worker will put their ID and create a new client record. Is it possible to make it only possible for this worker to edit this client record in the future? ...the original creator will be the only one able to edit the information.
-I am thinking maybe have a table with all workers and associated passwords. So, if a user tries to open a subform created by another worker, he will be prompted to enter a password (which will be the one associated to the creator in this "secret" table.
View 5 Replies
View Related
Jan 25, 2006
quick question guys...
if i have a sales order that the sales order # is an autonumber and i manually delete the records my next new record still follows the last number i had before that is now deleted..
example
sales order 1001
sales order 1002
if i delete all the records on the table and clean it all out
the next new autonumber will be 1003...
i want it to be 1001 again...
and yes its set to an index of no dups
View 1 Replies
View Related
Mar 19, 2007
Hello all,
I have 3 tables:
1. customer
2. DVD collection
3. Borrow
The aim of this system is to create a home borrowing system.
The customer table has a one to many relationship with the borrow table, while the dvd collection has a one to one with borrow. I can create a new book with no problem, and even view these on a form. Here my proble arises.
I ahve another form to return a DVD. I view the records from the borrow table, and once found what i want there is a button which deletes the record from the borrow table. Sadly, when i press this button, not only does it delete the record in the borrow table, but it will also delete the record from the DVD collection table.
I have tried everything i can think of, and i don't want to change to change the design as i have found this mnethod very easy to generate reports and the like. Any help??
Thanks
EDIT: the button i used was from the wizard that comes up when you create a button.
View 2 Replies
View Related
Nov 24, 2004
Looking for hint how to avoid systems message box ("you are about to delete n records...yes, no") when deleting records from the table.
respect
View 3 Replies
View Related
May 18, 2005
Hello.
I am using a large database, which usually works fine, and is set to compact on close.
Occasionally it has been losing a lot of data in the main table, probably when it compacts, down to a round number of records. This time it left me with 10,000 records exactly. (It has been different round numbers before)
Does anyone have any ideas as to what is causing this?
Thanks.
View 14 Replies
View Related
Jan 25, 2006
quick question guys...
if i have a sales order that the sales order # is an autonumber and i manually delete the records my next new record still follows the last number i had before that is now deleted..
example
sales order 1001
sales order 1002
if i delete all the records on the table and clean it all out
the next new autonumber will be 1003...
i want it to be 1001 again...
and yes its set to an index of no dups
View 1 Replies
View Related
Dec 27, 2007
Hi,
I am using Vb6.0 as a front end and msaccess as the db.
i want 2 delete all the records in a table "Register" by clicking a menu
The connection is made using ADODB
Till now i hv the code
Private Sub mnudel_Click()
Docmd.SetWarnings False
Docmd.RunSql ("DELETE * FROM Register;")
Docmd.SetWarnings True
End Sub
But when i execute this a error msg displays
Run time error "424"
Object required
Whats the problem in me
plz help me to come out from this...
View 2 Replies
View Related
Apr 11, 2007
i know this must be a piece of cake but i'm new to Access!
Anyway, am using a delete query and want an expression that i can use in the criteria to allow me to detect (and delete) records that are 5 years old. i used Date() - 1825 but was wondering if there was any other way or function that would allow me to acheive this. any help regarding this would be appreciate! hope someone can help.
View 4 Replies
View Related
Apr 30, 2008
I am having problems deleting various rows from an SQL table, the message coming up is "The row value(s) updated or deleted either do not make the row unique or they alter multiple rows (xxrows). Any Suggestions?
View 1 Replies
View Related
Feb 2, 2005
I have a simple form with a subform on it (see enclosed Access 2000 Database). I'm trying to add/change/delete records from table: Component Name. Adding and changing records is not a problem but deleting is. It only deletes the value of the field "Interative Component Name" and not the entire record. I have my joins defined properly on the tables. What am I missing? I wish this Access stuff was easier to learn. Any help/clues would be greatly appreciated.
Thanks
Sue
View 4 Replies
View Related
Nov 2, 2005
I have a "display only" subform that is updated by a popup form. If I add or amend an entry the details of the changes are displayed immediately in the display window by requerying the form "afterupdate". However, I have a delete button on my popup form which will delete a record but replaces it with the word #deleted in each of its fields. The #delete will only disappear once I have moved to another record which I don't want to do.
Can any one tell me why the amend/insert update works well but the delete behaves in this way.
How can I set up the delete function to function and remove the #deleted message without moving to another record. I have tried adding a save button but this doesn't fix it.
Thankyou
View 14 Replies
View Related