A Way To Delete A Field In A Table Safely

Sep 2, 2005

I'm using Access 2000. I want to remove a field from an existing table and I'm not sure if this field is used in any of the existing queries, I really don't want to have to manually check all 100 queries to see if it's been used. Is there a query, macro or ??? I can write to do this? How?


Thanks
Martina

View Replies


ADVERTISEMENT

Quiting Safely

Sep 9, 2005

Hello All
At the moment when I click a button an Excel File Opens and Access closes (the Excel File cannot do what its supposed to do unless Access is closed).
Is there a way of quitting safely?

When the user clicks the button a message pops up saying Press cancel and save if you already havent saved

Then I use:

DoCmd.Save
Application.FollowHyperlink "MY FILE LOCATION"
DoCmd.QUIT

This wont cause any harm will it?

Cheers
Bikeboardsurf

View 1 Replies View Related

Safely Removing Replication From Access 2003 Db.

May 1, 2006

The short Questions:
1) How do I safely remove replication from a copy of an MS Access 2003
database? Safely as in without affecting any of the other replicated copies?
2) How can I find all the copies of this database still being replicated to
after the design master has been lost?

The long Questions:
Hello All, I’m new to Access replication and have started at a company that
uses several Access databases with replication. We are creating a new site
using a similar database structure. I’ve made a copy and would like to start
by removing replication both because it is not necessary in our environment.
Also I’m about to make some database changes and am worried they changes or
record deletions will be propagated. As mentioned I do not believe there is
any reason to use replication for this project so I would like to remove it
for all databases, unfortunately several of the databases are very critical
so I want to be as informed as I can before making any changes since if I
break it and do not know enough to fix it my company would loose a lot of
money. Is there anyway from a given database (besides the replication master,
it has been long lost) to find all the databases that are replicated?

Lastly before undertaking this project is there any advice anyone here can
give me to better my chances of success? Any lessons learned?
-Brian Sky

View 1 Replies View Related

Tables :: Delete All Field Names From Table

May 21, 2015

I need to delete all the field names from my table so I can import a new excel file with different field name headings,

currently I run:

DoCmd.RunSQL "DELETE * from table1"

this deletes the data in the table, but not field names.

What Vba command will allow me to do this.

View 9 Replies View Related

Forms :: Delete Search Field In Order To Point To Appropriate Field?

May 6, 2013

I am using access 2010. I technically have an unbound form but I am changing the record source by command buttons. Switching between 3 command buttons. My problem is that I have a subform that I was linking to the form to an unbound search field. Now I want to switch the master and child links to a field on the form when I switch the record source which happen to be the same field as the unbound search field; however; it still pulls from the unbound search field rather than the field on the form. Do I need to delete the search field in order to get is to point to the appropriate field?

View 1 Replies View Related

Modules & VBA :: Copy Record To History Table And Then Delete It From Main Table

Jul 9, 2014

I have a form with a sub form. when a record is choosen in a combo box the sub form is filled out with a record.

what I am trying to do is have a button that will copy that record to a history table then delete it off the the main table.

I cheated by using the wizard to get the code to delete the record but I am having troubles modifying the code to copy that record to the history table. Here is the code below. I have tried to insert code in several places but it just errors out.

'------------------------------------------------------------
' Master_tbl_sub_fm
'
'------------------------------------------------------------
Function Master_tbl_sub_fm()
On Error GoTo Master_tbl_sub_fm_Err
With CodeContextObject
On Error Resume Next

[Code] ....

View 8 Replies View Related

Queries :: Delete Main Table Row Depending On Sub-table Row If It Is Null

Dec 25, 2014

i have two data tables, one is depending on the other. now i need to delete the main table row depending on the subtable row if it is null.

View 3 Replies View Related

Delete All Rows In Master Table If Identical In Second Table - SQL

Jan 13, 2006

A SELECT works:

SELECT *
from mastertable
INNER JOIN secondarytable
ON mastertable.Identicalfield = secondarytable.Identicalfield

But none of these do:

DELETE
FROM mastertable
INNER JOIN secondarytable
ON mastertable.Identicalfield = secondarytable.Identicalfield
**Incorrect syntax near the keyword 'INNER'.**

DELETE
FROM mastertable JOIN secondarytable
ON (mastertable.Identicalfield = secondarytable.Identicalfield)
**Incorrect syntax near the keyword 'JOIN'.**

DELETE
FROM mastertable
WHERE (mastertable.Identicalfield = secondarytable.Identicalfield)
**The column prefix 'secondarytable' does not match with a table name or alias name used in the query.**

DELETE
FROM mastertable
WHERE IN (SELECT *
FROM secondarytable)
**Incorrect syntax near the keyword 'IN'.**

Can anyone help? This should be easy, shouldn't it?!
Thank you.

View 2 Replies View Related

Queries :: Delete Records In One Table Dependent On Another Table

Apr 17, 2015

I have a table which lists amendments (amendments history file) which need to take effect of another table (M0070), I can select the records fine and so the sub query looks to be okay but I'm missing something (probably obvious) in the deletion query where by it does only delete the records selected but everything (I know that the asterisk is wrong in the code below but I'm not sure what to replace it with).

At this point I'm trying to delete all records for a specific employee on a specific contract (they can be 1 or more employee records for that individual on a contract - and they could exist on multiple contracts).

DELETE *
FROM M0070
WHERE EXISTS
(SELECT M0070.[Contract No], M0070.[Contract Name], M0070.[Employee No], M0070.Forename, M0070.Surname, M0070.Branch, M0070.[Long Desc], M0070.[Emp Post Start Date], M0070.[Days per week],

[Code] .....

View 3 Replies View Related

Delete Record From One Table And Have It Automatically Added To Another Table?

Oct 28, 2011

I have an employee and asset database. If an employee gets fired, I need remove them from the general employee records, but I want to save a record of that employee. Is there a way to delete an employee from one table and have it automatically added to another table?

View 4 Replies View Related

Cannot Delete Field !!!

Jul 12, 2006

I have removed the relationship and still can't remove a field. Any help??

I also tried compact and repair and then still will not delete.

View 1 Replies View Related

Need To Move Data From Table A To Table B And Delete It

Sep 20, 2006

Well I have two tables, one is the workorder register and the other is the closed work orders. This is for maintenance. I have a form for creating and veiwing workorders. I need to link a command button to the form that will delete the record being viewed in the WO REG table and paste it in the Closed WO table. I think I need to use two append queries but have no idea what I am doing. Here is what I have so far.

INSERT INTO [CLOSED WO] ( WO, MMCN, TECH, NOMIN, FUALTS, TYPE, [SECTION], CLOSEDATE, OPENDATE )
SELECT [WO REG].[WO], [WO REG].[MMCN], [WO REG].[TECH], [WO REG].[NOMIN], [WO REG].[FUALTS], [WO REG].[TYPE], [WO REG].[SECTION], [WO REG].[CLOSEDATE], [WO REG].[OPENDATE]
FROM [CLOSED WO], [EQUIP REG] INNER JOIN [WO REG] ON [EQUIP REG].[MMCN]=[WO REG].[MMCN]
WHERE ((([WO REG].[WO])=[WHAT WO TO CLOSE?]));


Like I said I have no idea what I am doing, this is out of the SQL view for my "move to closed WO" query. the fields I need to move are WO, MMCN, TECH, NOMIN, FUALTS, TYPE, SECTION, CLOSEDATE, and OPENDATE.

Is this even remotly right? I know nothing of VBA an all these symbols mean nothing to me.

View 4 Replies View Related

Help Needed :If Table Exists, Then Delete Table

Jun 6, 2006

I need urgent help, I am required at my job to come up with a command that will check to see if a table exists, and if so, delete the table. The whole process goes like this:


There's a form, and a listbox. 2 buttons...1 is import a file and 2nd is generate report. In the listbox theres 3 excel files. You select one excel file then click on Import, followed by clicking on Generate Report button.

The whole technical process is this:
1. A csv file is imported into a temp table
2. A temp table is created and named "_ImportedSKUS".
3. An append query is exectued to add the data from the "_ImportedSKUS" temp table to the final table, "Imported SKUs".
4. Then the temp table, "_ImportedSKUs" is closed and deleted.

I have a delete command at the end of the sub, which goes like this:

DoCmd.DeleteObject acTable, "_ImportedSKUS".

But I'm also need to generate an If statement before the loop that will check to see if the "_ImportedSKUs" table exists, if so, delete it (using same code listed above) and end if.

Can anyone help me out here???

View 4 Replies View Related

Delete Space In Text Field

Dec 5, 2007

In my Dbase, I have a table with a text field. Field name is Country
There are over 5000 records in the table and many of these in the Country field start with a space. I would like to get rid of this space as to ensure that all text starts with a character, rather than a space.
How can I achieve this.

View 4 Replies View Related

Delete Spaces In Text Field

Jun 28, 2006

We have a table with approx 2m records. Just three fields:
Key (primary)
Postcode
Postcode reference

The problem is with the postcodes. Many of these have a double space in them such as this DE13 7EL but we need DE13 7EL.

Find and Replace runs into a problem because of the number of records.

An update query seems obvious but we can't figure out what to put in Update to as this appears to return the literal value.
We are not VBA programmers so that isn't really an option for us.
How can we strip out that extra space?

View 6 Replies View Related

Delete Field Contents Automatically

Oct 14, 2004

Here is one that I could use some help with.

I have an Updates field in all of my tables. It, of course, holds my audit trail. Im tryiing to figure out a way that I could run a single command and clear the contents of all the Updates fields on all the tables in my db. Ideally, I'd like to auto generate a report for all the update fields on all the tables, then do a purge.

Any ideas?

View 4 Replies View Related

Tables :: Delete All Data From Field?

Dec 31, 2014

A database at our Food Pantry needs to be updated yearly on Jan. 1 by eliminating all data in two fields: "ID Check Date" (date field) and "Signature Obtained" (check box). There are hundreds of records. Is there a way to remove the data from the two fields (columns) while retaining the fields (and their formats) but with no data? We use Access 2010.

View 3 Replies View Related

Delete Table

Oct 9, 2007

little question here:

1) table deleting
i have a table in which temporary data is stored;
With a command button i want to delete the table (or maybe just the data in it);

2) information from table in textbox
In a form i have a textbox in which the data is mentioned from the table, after clicking the delete table button, i want also the texbox to be empty

First i tried to put the following code behind the onclick event but doesn't seem to work(?)

DoCmd.DeleteObject acTable, tTable


It should be quite simple (i think?); please advise,

Thanks

View 1 Replies View Related

DELETE From Table

Apr 9, 2008

if I had tblOrders OrderNo, CustomerNo, Date, OrderTotal
tblCustomers CustomerNo, Name, Street, Country, Postcode

and I was asked to delete orders placed by customer Smith, would I be correct if I put this:

DELETE tblOrders*
FROM tblOrders INNER JOIN tblCustomers ON tblOrders.CustomerNo = tblCustomers.CustomerNo
WHERE Name = "Smith"


I wasnt sure about the DELETE tblOrders to have a '*' after it or not . .

View 3 Replies View Related

Delete Fields Referring To Field Number

Aug 5, 2006

I need to trim a lot of tables. Is it possible to delete table fields with reference to the field number instead of field name?

The command 'tblMyTable.Fields.Delete ("FieldName")' takes a string (field name) as input. I rather like to - in a loop - delete say,

Sub DeleteFields()
For i = 40 To 60
tblMyTable.Fields.Delete Field(i) ' Not correct syntax
Next i
End Sub

thh

View 2 Replies View Related

Queries :: Query Returns (DELETE) As Field Value

Mar 18, 2015

I have a query, and when I execute it, the correct data set is returned. However one field shows "DELETE" as the value for all records.

when I ran it on the SQL server management studio as a test it ran fine. End user does not have access to the tables, so I created a small MS Access application. When I ran the query in MS Access, then connected table dbo_DocRef > Notes shows a value of DELETED.

What am I missing?

View 5 Replies View Related

Auto Delete Record On Date In Field

Jan 1, 2014

I have a database of personnel. People come and go all the time; however I can't have a personnel record deleted as soon as they leave. They remain on our books until a specified date for each individual. The date is different for each individual. I was hoping to have a field in their record with the date, and have a query or some code delete that record on the date in the field. Is this possible?

View 7 Replies View Related

Delete A Record From Table

May 9, 2005

Hi,

Is it possible to delete a record from a table whilst viewing that table through a form. The awkward part though is because I have another table linked to it.

Basically the main table is Orders and the other table is Items (these items make up an order). So when I go to simply click on delete an error message appears saying that I cannot delete the record but there are records attached to it in another table. This is fair enough but is there a smooth way off deleting off the items?

Many thanks,

Paul.

View 3 Replies View Related

Delete Fields From Table

Aug 30, 2005

Hi

Is there a automatic way i can delete Fields from a Table? This table gets input into the database very frequently as updates come in and i'd like something like a Query or Macro, where i can define which fields i dont want, to delete the 30+ columns of useless data.

Can't see how to do it with a Query or macro though

Anyone have any ideas?

Thanks

View 5 Replies View Related

How Do I Delete Last Record In Table?

Jun 21, 2007

Hi all, whats the simplest way to delete the last record in a table? based on
DoCmd.RunSQL "DELETE * FROM

Trying to use a button to do the above

Cheers

View 5 Replies View Related

Delete Table Confirmation

Aug 2, 2005

is there any way to get rid of deletion confirmation when you run a make-table query. though I unchecked all boxes under Confirm on Edit/Find tab, still popping up.

thanks in advance

View 2 Replies View Related







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