Edit A Query In SQL View To Perform Multiple Actions

Aug 11, 2005

Hi,

How can I edit a query in SQL view to run multiple lines of SQL?

For example I can use the GUI to create a query, then in SQL view enter the following:

DELETE
FROM Employees_copy;

which clears the Employees_copy table. Perfect. But what if I want to do this for mulitple tables in the same query eg for a second table Employees_copy_2 as well? I've tried


DELETE
FROM Employees_copy
DELETE
FROM Employees_copy_2;

which gives a syntax error, as does

DELETE
FROM Employees_copy,
DELETE
FROM Employees_copy_2;

any suggestions?

View Replies


ADVERTISEMENT

Datasheet With Edit/view Button HELP!

Sep 10, 2006

I seen this awhile ago. And I was interested i knowing does anyone know where I can get an example of this. I saw what looked like a datasheet but on the right side of the datasheet there was an edit button. So every field on the datasheet had an edit button which opened up the specific row in a form layout. Can someone

View 3 Replies View Related

When Opening A Database I Can Only View & Edit The Form...

Jul 9, 2007

Hello,

When I attempt to open any of my Access databases I am presented only with the form that has been selected as the 'startup' option. Furthermore, it seems to be impossible to switch to 'design' view and my only options on the toolbar are File, Edit, Insert, Records, Windows, Help. As far as I can tell, none of these enable me to select the options required to give me my entire database back.

I am something of an Access novice, so if the above problem seems familiar to anyone i'd be grateful for the solution! The help option within MS Access hasn't been particularly useful.

Many thanks,

David

View 3 Replies View Related

How To Make Mainform View Only While Allowing To Edit On Subform

Jun 25, 2005

May be this is easy for your guys. I want to freeze or lock the mainform data fields while allowing users to input, edit, delete data on a subform. I tried to change mainform properties so it can not edit, add or delete data on mainform. By doing so, I cannot do anything with subform, it seem read only as well.

Thank you for help

Peter

View 1 Replies View Related

Forms :: Button To Change Form From View To Edit

Mar 12, 2014

I have created a form in Access 2010 that opens in view only mode. I do this as I do not want data being changed in error. There are times when the user may need to edit some data on the form.

Any way to place an "Edit" button on the form that allows the user to edit the current record? I thought about creating two sepasrate forms, but I really don't want to maintain two of them.

View 1 Replies View Related

How Do Perform An Update Query From One Table To Another?

Apr 4, 2006

Hi there.
Does anyone know how to use an update query to copy some records from one table into another?
I have table1 which has all the contact details and what I would like to do is work out a process for importing records from an excel spreadsheet.
What I have so far is as follows:

1. In access go into the queries tab and select update query
2. Open both table1 and table2
3. Drag the fields to be updated (table1)
4. In Update to select [table2].[table2 column name]

When i run this nothing appears to happen. 0 records are appended.
Does anyone now how to go around this with another solution or should I be using other SQL methods?

All comments much appreciated
Thanks

View 1 Replies View Related

Queries :: Get A Query To Perform A Calculation And Round The Results?

Feb 20, 2015

I'm trying to get a query to perform a calculation and round the results.

The fields that I am running the calculation and am trying to round are Data Type Number, properties Field size Single and decimal places Auto.

I have tried the built in function described in Allen Browne's site to no avail.

[URL]

I have tried rounding the individual fields and then adding result.

I have also tried rounding the result (as attached).

View 11 Replies View Related

Modules & VBA :: Edit Multiple Records From List Box?

May 25, 2014

I have two table. Table 1 (assets) list all my assets etc. Table 2 lists all servicing for each asset.

I have a form which generates a list box of items that require servicing (once servicing has been completed on these items) I would like to update all records, in both tables. Table 2 with all the information about the service. and Table 1 with (only) the next service date.

I have set the list box to allow multiple selection and have used the following code to allow new records to be update in table 2 (which works). but I cant seem to get the code to edit one cell in table 1.

private Sub Command59_Click()
Dim strSQL As String
Dim db As DAO.Database

[Code].....

View 4 Replies View Related

How To Have Actions At The Close Of Mdb

Jul 13, 2006

How can I perform an action when ever the db closes…
Basically I have a table, users, and when the db starts a logon form is used. Once the logon is successful it records into the user table that a user is logged in. I want to at the close of the db rewrite the record to show that the user is not logged in.

So say user A logs in successfully so then the users table would show
Key | Name | password | logged date | currently logged on(these are the column headers)
Somekey | user a | ***** | somedate | yes

I want to rewrite the yes to a no when the db closes and the user is currently not logged on.
For the rewrite I can use a simple SQL statement to update the users table, the question is where would I place this code, the on close property for the switchboard is not enough, is there an on close property for the entire db.

View 3 Replies View Related

Prohibiting Certain Actions By Users?

Jan 6, 2007

Hello all,

About 2 years ago, I created a database (my first real one actually) which is extensively used. I havent had to maintain it too much in this time but I was looking at the live table data and noticed that the users are placing inappropriate entries in fields designed for other data such as listing the Company name where the last name of the person should appear and also they are using the first name field for the entire name of the person (lastname, firstname). Knowing this is an issue, I contacted the user who didnt seem to care as thats how they chose to use the database. Since Im the person who created it and Im ultimately responsible for it, I would like to prohibit these types of entries in the future. Does anyone know of a way to force integrity in an example such as what I outlined above? I thought about trying to prohibit the use of a comma in the form field, but then I suspect they would probably choose something else or nothing at all and we would be at the same point with no resolution. Im not trying to be a jerk, but the point of the DB is being tossed away because the users choose to be stupid. Any help would be greatly appreciated.

Thanks!

Steve

View 3 Replies View Related

Using Multiple Combo Boxes To Retrieve (not Edit) Records From A Table

Mar 24, 2005

I'm creating a form that has combo boxes pertaining to each of the following fields from table "Documents": DocumentID (primary key), DocumentTitle, DocumentAuthor, and DocumentYear. No combo box is used with any priority over the others. The working form will allow a user to retrieve the full document record (data for all fields) by using any combo box they want, as well as any combination of combo boxes. This means that if a selection is made in one field's combo box, the drop-down lists in the other boxes need to update based on that preliminary selection. The filtered results for each field, based on any and all combo box selections, are always shown in a single datasheet on the form.

The kicker is that when a user starts filtering records by making selections from the drop down list in a combo box, but then decides to TYPE in another field's combo box, I want the combo box they typed in to do two things: 1) filter the records for that field based on what they typed, if any records meet that criteria (e.g. they typed "B" so only records beginning with B are shown), and 2) if no records match the typed criteria, the search starts all over (at the top of the cascade), filtering all library records based only on what they typed in the most recent combo box.

Does that make sense? Any tips welcomed.

I don't know how to cascade combo boxes in this way.

View 2 Replies View Related

Selecting Items And Automating Actions

May 19, 2012

I have a report, which shows all unsold items for a particular auction date, and I have created a form using this report.

I'd like my sister in law, to be able to go through and easily select which items to relist, and which to return.

I've tried using a subform, but I've either not done it correctly, or its not quite the right tool for the job. I've tried listbox control but can't get it to work properly either.

Once she has gone through the list ticking one or the other, I'd like to be able to automate with a button "Relist" and a button "ReturnItem".

I'd like Items to be returned - to automitcally close item off so it no longer incurrs a weekly listing fee and change status to "ReturnToSeller" and the relist ones, to create a new entry line into the main item table, with replicated information, except it clears out the "lot number", as they enter that manually when the generate a new list for the next auction, my ID numbers remain current and unchanged but the tableID is automated to a new one which is my key number.

then on my invoice, I get for instance, 3 rows for one Item, which could have 3 different lot and ID numbers, and get a listing fee of £1.20 for each week you see.

How can I automate the actions to relist and Return to Seller?

View 3 Replies View Related

'Exceeds The Limit Of 1,000 Row (actions) For A Macro' But Does Not Apply!

Jun 17, 2005

Hi.
I have a table used for years. I added new fields bringing number to 160.
When I go to insert another row, I get message saying 'Row inserted in the grid exceeds limit of 255 rows for table or 1,000 rows (actions) for a macro.'

BUT as the number of records had not increased and I am under the 255 limit why the error message?

I tried in vain to copy and compact/repair the database, but still no luck.

Ideas?

Russ

View 14 Replies View Related

Forms :: Buttons To Store Actions And Dates?

Apr 8, 2015

Suppose I need a database with customers, able to store: what different events, were performed on what date.

So let's say possible actions are: a customer called, emailed or visited.

(note, it might be possible that a customer both called, emailed and visited on the same day)

Should I start with four different tables for: customers, called, emailed, visited? Or would the three actions just go into one table?

Another aspect that I don't understand at all yet is how to proceed with the dates.

Should I create another table with a long list of possible dates for the coming x-years?

I would like it to work:

I am thinking about creating a form with buttons behind the terms 'called', 'emailed' and 'visited'. When one of those buttons is pressed, I want an entry for that action, day and customer entered in the database.

So that later on I could e.g. look up on what day how many customers called, etc. etc.

View 11 Replies View Related

Add Identifying Information For User Actions That Took Place

Oct 20, 2015

I don't know if this can be done. I'm using Access 2010 and I have users updating information on a hourly basis.

Can I have a field that basically shows the last user that edited the form or saved it?

View 6 Replies View Related

Need To Perform A "lookup And Classify" Type Query

Nov 2, 2006

First off, please be gentle with me, I am a total noob on Access/SQL/etc....

Here's what I'm trying to do.

let's say I have one table with data like this

Class range
Class ValLow ValHigh
----- ---- ----
Class1 0 50
Class2 51 65
Class3 66 77
Class4 78 90
etc.


Data to classify
Entry Val
----- ----
A 10
B 26
C 52
D 85
etc.


I want a query that returns:

Entry Class
----- -----
A Class1
B Class1
C Class2
D Class4


Now I suppose this could be done with an expression with a lot of IIF's, but there are potentially THOUSANDS of classes/ranges in my real data.

I doesn't seem that Access has the concept of a CASE statement, and even if it did, it would be a huge CASE statement.

In Excel this would be trivial using a temporary column and a Vlookup, but I have hundreds of thousands of records.

How can I create a query that will do this classification? I don't even know enough about how to do it to figure out what to google on... :(

View 11 Replies View Related

Automatically Updating Client Settings For Confirm Actions

Feb 27, 2014

how I can automatically change the Client settings either with a macro or code. Specifically for the three confirm actions (Record Changes, Document deletions and Action queries). I have a database that is distributed to end users in different offices around the world. The old way lazy way, was to go to each computer and set these settings to "off" manually, but this isn't possible. I want to be able to run delete queries and action queries in the back end without the end users knowing its happening and having to select yes all the time.

View 3 Replies View Related

Forms :: Data Not Updating When Open Form - Refresh Actions?

Jan 31, 2014

Test findings showed that when I open a form the data does not update. I added a refresh action after the openform action. If I want to open three forms via the macro, do I need three refresh actions, one after each openform action, or simply a single refresh action that would apply to all three forms.

Scenario 1:OpenForm1, Refresh, OpenForm2 Refresh, OpenForm3, Refresh
Scenario 2:OpenForm1, OpenForm2, OpenForm3, Refresh

View 5 Replies View Related

Multiple Record View

Sep 19, 2005

I'm new to Access and need some help. I'm trying to duplicate a Lotus Notes view using Access. That is, I want to display multiple records of the database, similar to the datasheet view, but only certain fields of the database and filtered. When the user clicks on the record they want to display or edit, the single document form will display for that record. Is this doable in MS Access? Any help is appreciated.

View 4 Replies View Related

Design View Keyboard Shortcut - Expand Columns In Design View Of A Query

Jun 5, 2014

I'm looking for a keyboard shortcut to expand the columns in "design view" of a query.

What I mean by this is rather than selecting all of the columns and double clicking to see the entire text, I'd like to be able to a shortcut.

The entire process as I see it involves 3 steps so I will need thesolution to the 3rd step.

(1) [ctrl+spacebar] to select initial column
(2) [shift+arrows] to select all of the columns I need
(3) [keyboard shortcut] will expand all of the columns "field" names to the size of the column heading

Alternatively, if you know of a shortcut that will expand the columns without having to select them first I'll take it!!

View 4 Replies View Related

Be Able To View Multiple Tables In One Form Without Using Wizard !HELP!

Jul 14, 2005

Hello, New to the board. I need your help/advice.

I have a: Movie Form. Table Actor and Table Director in my database.

on my Movie Form I have a combo box, where users can click on any movie on the list and display both Actors and Director information according to the Movie Title they select.

To accomplish this I use Subform/Subreport Wizard to add each Table to the Movie Form. Because When I try to bound the Specific Data to a textbox I use, the Field List is EMPTY.

My question is how can I make my Movie Form have acouple TEXTBOX's that change accordingly to the Combobox without having to use the Subform Wizard to import the info from my 2 tables.

I hope this make some sense, im just learning. Any help would be appreciated.

Thank YOU

View 1 Replies View Related

Filter Table By Multiple Values In Datasheet View?

Nov 1, 2011

Back in A2003, I could filter a table by the In() function with the table open in datasheet view. A2007 doesn't seem to want me to be able to do that. How do I filter a table by multiple values while in datasheet view to be able to delete some records.

Background: I get a datasheet in every month that, due to marketing to the same customers in different month, the YTD file I get has duplicate accounts. I have to delete one of the records, but the criteria for deletion aren't something I can query for. This is why I need it open in datasheet view.

My alternative is to make a table out of the duplicate entries, delete those from the original table, then append the cleaned accounts.

tHow do I filter a table in datasheet view?

View 4 Replies View Related

Deleting Multiple Records From Access In Datasheet View?

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

How Do Perform Lookup

Mar 10, 2006

Hi i really need help!

i need to be able to use "lookup", i have a set of postcodes from 3000 customers, i need to extract these and compare them to lists i have of postcodes, which make up a region. And run queries from these

e.g a customer on my database has the postcode BD21 7KK

On my list of postcodes i have on paper - WEST YORKSHIRE - BD21 7

therefore The BD21 7KK Customer falls in the West Yorkshire region.

I need to do this four 4 regions with lists i have on paper then run queries.

Can some one please provide the neccessary steps?

Or even give me an example made?

Im really stuck on this at the moment and me job depends on it ! :(

Thanks

View 1 Replies View Related

Field To Perform This Calculation

Feb 23, 2007

How do I get a field to calculate this formula?
I want a script to find the precise current date and from another field find a number and add it to the current date day to make current date + number = date in the future.

For example
Field: Total Nights Hired = 2
Field: Date due back = 23/02/07 + 2 = 25/02/07

I am sorry if I did not explain this well enough. I am totally new to databases but need help in my corsework. I am designing a video rental system.

Any help will be greatly appreciated.
Andy

View 7 Replies View Related

How Do I Perform A "not Like '*xxx*' Scenario

Apr 20, 2006

I know how to do a "Like '*xyz*' " type condition in a query. How do I set up a "Not like '*xyz*' " type condition in a query?

Thanks for your help. This forum is wonderful!

View 3 Replies View Related







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