Prompt Not To Delete If There Is Value In Subform

Apr 25, 2006

i have a main form with a subform. the subform value has "ID" value with a relationship with the the main form. now if i delete a record from the main Form, the records in my subform will have no value to relate to.

i do have a Delete Button in my main form , so what i want is, when the Delete Button is pressed, Check if there is any records in my Subform, and not to allow me to delete unless i move these records from the Subform

here is my current Code for the Delete button ....

View Replies


ADVERTISEMENT

Changing Column Widths In Subform Bound To A Query Throws A Prompt

Aug 22, 2006

i have a subform on a form with Source Object="Query.myquery", my form is generating a sql string dynamically and assigning this sql string to the RecordSource property which works fine. But now if the user changes the width of the columns in the subform and close the form , a prompt is thrown asking if the "myquery" needs to be saved. I dont want to save the settings of "myquery" but at the same time avoid this modal dialog. If i use DoCmd.SetWarnings=False , i dont see the warning anymore BUT the query gets saved.

I am using "myquery" to just display column names in the subform when the forms loads and also without it i cant directly use RecordSource property in my code.

any suggestions?

View 1 Replies View Related

Help To Delete A Record From The Subform

May 13, 2005

I have a subform its not in datasheet view and gives details of bookings for clients.

I am using the on click event of a field and I know that access knows which record I clicked. How do I delete it? which method do I use. can it be done without searching as I know which one i clicked?

regards in advance.
:eek:

View 6 Replies View Related

Delete Record In Form With Subform

Mar 15, 2006

I amd having trouble putting a delete cmd button in a form that has a sub form on it. The errror reads "the record cannot be deleted or changed because table "details" includes related records".

View 3 Replies View Related

General :: Cannot Delete Records Added Through The Subform

Feb 19, 2013

I have 2 sub-forms attached to a main form. Each of these forms are based on different tables. Whenever I input the record, it goes into respective tables. However when I try to delete the record, it only deletes the record from the main form. I tried cascade delete. However, since referential integrity has to be established, I cannot add the record to my subform because there has to be a corresponding record in the parent table for me to add the record in the subform.

View 2 Replies View Related

Forms :: Delete Record From Subform And Table

Oct 23, 2014

I am getting a problem with delete button..I want to delete record from subform and Table..

Table:Payroll
Subform:PayrollSearchQuery
Form:Payrollog

I am giving the code is ....

Private Sub Command58_Click()
'check existing selected record
If Not (Me.PayrollsearchQuery.Form.Recordset.EOF And Me.PayrollsearchQuery.Form.Recordset.BOF) Then
'confirm delete

[code]....

View 3 Replies View Related

Modules & VBA :: Delete A Selected Record In A Subform By Using A Button

Jan 12, 2014

For school I have to make a application in access how to delete a selected record in the table in a subform by using a button. The subform is in the main form and the button is also in the main form

View 14 Replies View Related

Forms :: Add And Delete Lines From Table Directly On Subform

Dec 6, 2013

I have a bound subform that lists all of the relationships from my unbound txtJobNum control and I can add and delete lines from the table directly on the subform. What I really need is to NOT update the table unless I click on my save command button.

View 2 Replies View Related

Modules & VBA :: Delete Records From A Table Using Controls On A Subform

Jun 20, 2013

I have a sub form that allows users to add staff to a project team, once added it populates a table which updates the subform showing the selected employee. I am trying to enable a delete function that allows users to remove an employee from the project team in the subform showing selected staff. Here is the code I have so far, but it doesn't work;

Code:
Private Sub Command4_Click()
Dim dbs As Database
Dim rs As Recordset
Dim sqlstr As String
Set dbs = CurrentDb
sqlstr = "DELETE tbl_CapexStaff.* FROM tbl_CapexStaff WHERE CAP_ID = Forms!frm_Switchboard.CAP_Live"
dbs.Execute (sqlstr)
End Sub

View 4 Replies View Related

Forms :: Delete Records In Subform Based On Check Box In Parent Form

Mar 1, 2015

I have a parent form and connected to it is a subform. On the parent form I have a checkbox which enables and disables fields on the parent form and also hides the subform.

What I want to do is when the user unchecks the checkbox, this action also deletes the associated subform records, if there are any.I'm sure that this can be done with an SQL Delete query in VBA.

View 5 Replies View Related

Modules & VBA :: Delete Of A Record From A List Of Records In A Subform Deletes Wrong Record

Jun 28, 2013

When we browse through records in a subform we store the records in the database.When we want to delete a records for example the third record from the five records always the first records will be deleted. How can we delete the records where the cursor is at? When we are at the third record and press the delete button the third record from the list in the subform should be deleted.

Code:

Option Compare Database
Dim FocusBln As Boolean
Private Sub Identificeer()
Me.[Datum Aangemaakt].Visible = True
Me.[Datum Aangemaakt].SetFocus
If Me.[Datum Aangemaakt].Text = "" Then

[code]...

View 11 Replies View Related

Access 2010 - Delete Form Command Button With A Password To Confirm Delete

May 6, 2014

All I am trying to do is insert to have a form with a "Delete Record" button on it. The problem is I don't want anyone to be able to delete a record, I would like someone to have to insert a password to confirm the delete.

View 13 Replies View Related

Query Lets Me Delete But Doesn't Actually Delete...

Apr 2, 2007

I have a query based on two tables, joined on one field (this field is the primary key in Table A. Table B doesn't have a primary key). When working inside this query, it gives me the option to delete records. However, when I try, the row disappears from the query but then if I save and close and either re-open table A or the resulting query, that record is back. It doesn't actually delete. If I go to table A directly and delete it, it's gone for good.

How can I make it so that when I delete the record inside the query it actually deletes? And if that's not an option, can I make it so that it doesn't seem like I can delete records inside the query so that people don't make the mistake?

View 2 Replies View Related

Get Rid Of The Prompt!

Dec 1, 2005

After I do a "DoCmd.RunSQL "Update ..."" I am asked if I really want to perform the 'Update'. Does anyone know if there is a way to get rid of the prompt and just carry out the query?

Thanks

View 1 Replies View Related

Prompt To Save?

Feb 1, 2008

I have noticed that when i am editing an object within my database, specifically a query and click to close it, it doesn't prompt me to save the changes and does it automatically. There have been cases where i do not want to save the changes and just wanted to know if there was a simple setting to turn off automatic saves?

View 3 Replies View Related

Query Prompt

Jul 20, 2005

Is it possible to put a combo box with a drop down list in the Enter Parameter Values of an update query so that the user selects from the list instead of typing the required value?

Tony

View 10 Replies View Related

Prompt Query

Feb 17, 2006

:confused: I have to build a query to do the following

my table consists of 7 fields
cg
price
gross
open
IM
state
sdate

I want to build a query that will prompt the user for 3 of those fields:
price , gross , IM

BUT:confused: when prompted I want the user to have the capability of changing the operators ie: > , < , = etc.

one time they may want
price > 100000.00 , Gross = 50000.00 , IM < 8

the next time they run it they may want:
price < 50000.00 Gross > 45000.00 IM = 4.5

Is this possible

View 14 Replies View Related

Run Query Without Prompt

Jun 29, 2006

Normally I would run a query like using 'CurrentDb.Execute' so that no user prompt occurs, but how do I avoid prompts when I need to run an update query?.

I'm using DoCmd.OpenQuery "qry_UpdatePW" with no joy!

View 2 Replies View Related

Prompt For A Field

Apr 26, 2005

Have a master table with say
Product no Product description qty

Then I have another archive table with
Product no 1_qty Q2_qty Q3_qty O4_qty

All I want to do is to (at the end of each quarter) archive (transfer) the qty from the master
table to the archive table at a user level.
Meaning I need a control button which does the lot and I suppose prompts and asks which
quarter do I want to archive to. I know how to manually do all that, but is it possible to have
a prompt which determines what field is used i.e Enter 1 then the field Q1_qty is udated.
Hope I have explained this ok.
Appreciate some help.
Thanks Norm

View 4 Replies View Related

Prompt As Combo Box???

Jul 13, 2007

hey guys

I have a query that ask for an input. I was wondering if there is any way to make the prompt have a combo list, so the users can scroll and select the input ,which will generate the Query results,instead of having to type the input in.
will really appreciate your help.

View 1 Replies View Related

MS Access Read Only Prompt

Jul 11, 2005

I am using windows XP SP2, Office 2003.

I have created a database to store information from a mine site. I have set up a switch board and most users will just view reports or graphs that have already been designed.

I want the general users to open the file read only without having to open access and use the open read only command. I also don't want to go down the path of database security if it can be helped.

I read in the help page that there is a read only prompt that can be flashed up when the file is opened. Unfortunatly the help page suggests, Tools > Options > Security Tab (tick read only prompt). In office 2003 this option no longer exists (if it ever did)

Any ideas, would be good if i could add something to the shortcut and then have some uses use this shortcut.

Thankyou

View 1 Replies View Related

Always Login Prompt In Access

Apr 26, 2006

I really need some help guys.
For some reason Access always asks for a login/password even if the database isn't protected. Even when I start a brand new database the prompt comes up. Any ideas as to how to get rid of this.:confused:

View 2 Replies View Related

Prompt For Default Values

Aug 1, 2007

Hi All,

I am hoping to create form that will prompt the user to enter default values for certain fields ie Week No and WB Date before allowing any data to be input into the form.

Any help on how to do this would be appreciated.

Thanks,

Mary

View 3 Replies View Related

Prompt To Save Changes But No Changes Were Made

Feb 9, 2007

I was editing one of my tables in datasheet view and when I closed the table, Access asked me if I wanted to save changes. But I didn't make any changes to the design of the table or the filters I had set up. I just edited the data within datasheet view. The reason this is bothering me is that I am afraid I accidentally changed something. The only explanation I have for why it asked me if I wanted to save changes, is that I used the "undo" command to cancel a typo that I made while editing in datasheet view. When I hit "undo", it fixed the typo, and scaled back up to the first record of the datasheet. At first I thought using the "undo" command might have been the culprit, but when I re-opened the table and used the "undo" command again, it undid the change, but it didn't scale back up to the first record of the datasheet, like it did the first time I used the command. Anyway, I am staying away from the undo command from now on. It's about worthless in Access anyway, because it only undoes your last action. Have any other Access users been asked to save changes when they know they haven't made any changes to the design of the table?

View 2 Replies View Related

Copy Table With Prompt For New Name

Aug 13, 2007

Once at the beginning of each month I extract all new cases from last month into a table. The table has a generic name as I repeat this step monthly. I would like to save or archive the data each month without having to manually copy and paste the table and rename it, prior to the new extraction, so that I have a record of each month. The archived table will not be used in any queries or reports.

The table I want to copy and rename is named 'tblSampleFrame'

At the beginning of the month before I delete the contents of the 'tblSampleFrame' to pull the new data, I would like to copy the old table and include a date in the new name. How would I set up a button on a form to copy the file and prompt me for the new file name? The new name would be 'tblSampleFrame_mmyyyy' where I can specify which month and year.

View 3 Replies View Related

Prompt For Date Issue

Feb 7, 2006

I have a need to prompt a user for a date, When they enter that date the qry should do as follows.

if rec_date <= (DATE PROMPTED FOR) and rel_date is > (DATE PROMPTED FOR) ,
then
return Qty and a few other fields....

No the DATE PROMPTED FOR is not a field in the table.

Do I need it to be?

View 14 Replies View Related







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