Moving Records In The Same Table?

May 22, 2006

Hello there,

Is it possible somehow to move a record in the same table, to different row (in the form)? Or in other words, is it possible manualy adjust the position of records (rows) in a report?

I have a continuous form, where rows are filled with data (e.g. 10 rows ).Then i have report , which looks the same as form (rows, and their order). But sometimes user wants to move certain position (row) up or down, to be it on top or bottom or two places above, or below etc, of row list....is there any easy way to do it? Like some button press, where you could swap position with next record (next row) .....

Or just delete (everything) and fill again from beginning the way he wants...

Thanks!

View Replies


ADVERTISEMENT

Moving Records To Another Table Then Delete

Mar 15, 2007

OK guys, ive done some searching and saw some stuff on this, but everytime I try something I get a INVALID SQL error message. So Im hoping you guys can help out cause Im lost right now.

I have a 2 tables, Training and Schedule. Training contains all the employees training records. Schedule is meant to be a temp table where the supervisors can enter the training and then once completed, can check the COMPLETED checkbox and hit the LOAD TO TRAINING RECORD command button and it moves ONLY the files for that trainee (a combo box) with a completed checkmark to the training table.

Ive tried this code sooooooooo many ways and its giving me a headache. My original way didnt work at all (had a lot of Do..Loop and With Statements, and then someone posted something about Archiving which is the code Ive gone off of now). Any help you guys can off would be awesome!

Heres what I got:

Private Sub cmdLoad_Click()

On Error GoTo Err_Load_Record_Click

UploadHistory

Exit_Load_Record_Click:
Exit Sub

Err_Load_Record_Click:
MsgBox Err.Description
Resume Exit_Load_Record_Click

End Sub

Sub UploadHistory()

Dim DB As Database
Dim WS As Workspace 'Current workspace (for transaction).
Dim strSql As String 'Sql Code.
Dim strMsg As String 'MsgBox message.
Dim bInTrans As Boolean 'Flag that transaction is active.

Set DB = CurrentDb()
Set WS = DBEngine(0)
WS.BeginTrans
bInTrans = True
Set DB = WS(0)

On Error GoTo Err_UploadHistory

'Execute the add.
strSql = "INSERT INTO [Training] " _
& "(TaskNumber, Date, Hours, TrainerLast, TraineeLast, Qualified) " _
& "SELECT " & "Schedule.Task, Schedule.Date, Schedule.Hours, Schedule.Trainer, " _
& "Schedule.Trainee, Schedule.Qualified FROM [Schedule] " _
& "WHERE (((Schedule.Trainee) = " & Me.TraineeCombo & " AND (Schedule.Completed)= 1));"

DoCmd.SetWarnings False
DoCmd.RunSQL strSql
DoCmd.SetWarnings True

'Execute the delete.
strSql = "DELETE FROM [Schedule] WHERE Trainee = " & Me.TraineeCombo & " AND Completed = 1;"

DoCmd.SetWarnings False
DoCmd.RunSQL strSql
DoCmd.SetWarnings True

'Get user confirmation to commit the change.
strMsg = "Upload " & DB.RecordsAffected & " record(s) from " & Me.TraineeCombo & "?"
If MsgBox(strMsg, vbOKCancel + vbQuestion, "Confirm") = vbOK Then
WS.CommitTrans
bInTrans = False
End If

Exit_UploadHistory:
'Clean up
On Error Resume Next
Set DB = Nothing
If bInTrans Then 'Rollback if the transaction is active.
WS.Rollback
End If
Set WS = Nothing
Exit Sub

Err_UploadHistory:
MsgBox Err.Description, vbExclamation, "Upload failed: Error " & Err.Number
Resume Exit_UploadHistory

End Sub

View 4 Replies View Related

Tables :: Moving Records From One Table To Another

Jan 16, 2014

I have to move records from one table to another.

When we lose a client I need to take them out of my current table and put them in my dropped table.

I don't want to lose my summary info and I want the dropped client to keep it's ID Number which is an identifier.

Seems I can't just copy it from one table to another and then go back and delete it from the Current.

Seems I can't cut from Current and paste into Dropped.

In a perfect world it would be great if my boss could just check a box in Current Table and the record moved to Dropped all by itself!

View 7 Replies View Related

Moving Records From One Table To A New Table?

Apr 10, 2012

1st - Table one, holds around 10,000 recordes, names and phone numbers and basic address information

2nd - Table two which holds all out customer details eg full name and case details and is used by an admin team

What I was hoping to do was have one form designed from table one and when the agent changes a status it moves the record from table one to table two.

View 5 Replies View Related

Moving Records

Mar 6, 2005

I would like a button on my form that will move a record from one table to another. Can anyone tell me how to do this

View 2 Replies View Related

Moving Old Records.

Oct 25, 2005

hiya!

i have a database that holds details of calls that have been answered on the phone concerning problems with computers.
details that are recorded are caller name, and date of call etc...

however, i want to know if there is a way that i can move all calls recorded BEFORE the present date to another table ( say a "past calls")..?

is there a button that i can put on my database that will run a function and move all calls recorded before the present date to another seperate table..?

thanks everyone!
johnny
:)

View 1 Replies View Related

Moving Records

Jun 27, 2005

Could someone assist me in getting code that allows me to move a record from one table to another when the user clicks a button.

Thanks

View 13 Replies View Related

Moving All Records In Field Down 3 Records

May 30, 2013

I currently have a database that I had to copy over each field from another databse to create the one i have now. When i copy the records from one field over it appears they all move up three spaces for some reason is there a equation i can enter to make them all move down three records in the table?

View 2 Replies View Related

Moving Invaid Records

Nov 28, 2006

Hi again

I have a table that’s full of records, I want to split it into 2 separate tables (identical structure but they have input masks), The input mask is set to LLL0000 all I want to do is send valid records to one table and invalid ones to the other.

I think the best way would be an update query but it doesn’t check the input mask only the validation (and trying to break the string apart using an expression is impractical and lengthy)

Can anyone think of any way of splitting this table – I’m getting rather desperate now and have been trying for over a week with no success

Any help is greatly appreciated

Thanks
Matt

View 3 Replies View Related

Help Moving Records From A Form

May 7, 2005

I have an Employee Database with a form that displays the employee record. When an employee leaves they want to be able to click on a button on the form and have the record moved to a different table. My thought was to do a append query to move the record from my active employee table to the termed employee table, but that would still leave a copy in my active table. I'm not real up on coding that much so Im not sure if there's a way to have code move a record from 1 table to another table or copy the data from 1 table to another table and delete it from the first table. Any help would be greatly appreciated.

View 12 Replies View Related

When Moving From Records On A Form

Sep 10, 2004

I was wondering if anyone knew how to check when the user has clicked to move on to the the next record on a form?

Ed

View 1 Replies View Related

Moving Record Information To New Records

Dec 29, 2005

Hi, found this forum looking for an answer to this question. Hope someone can help.

I'm trying to build a database that tracks electronic components. Mostly the database tracks location movements, but also repair issues and other possible changes. I'm thinking the best way is a database that has a record for each move, and any other changes are included in each record.

My question is, is there a way I can easily have the current information be propogated over to a new record, where it could then be modified? Example: I'm looking at a record of an item that was just returned to me. I would like to click a button on the form which would create a new record, then move all currently displayed information into that record.

Thanks for any help.

View 3 Replies View Related

Moving Through Records And Updating Sub Forms

Jan 23, 2006

hi all,

I have this database I'm working on and have a couple of issues I can't work out.

The first is this, I want to have my sub forms go to the last record when moving through the main form, currently I can only get this to work when I open the form?

If I move through the records in my main form (forward and backwards), the two sub forms go to the first record only, so how can I get them to go to the last recor?

I've attached the DB to show you what I mean.
Thanks in advance
Tez

View 3 Replies View Related

Moving Records Fluidly Between Tables

Sep 5, 2014

I am designing a database to keep track of a state's surplus fire property to be doled out to volunteer departments as I see fit.

I have a table for surplus property that includes what department currently has the surplus property, what type of equipment it is and additional equipment information. I also have a table for "pending transfer property" to track what pieces of property I have decided to potentially assign to a fire department from the state's surplus inventory.

My problem comes when I need to transfer a piece of equipment from one department to another. I would like the surplus property table to automatically remove the property from the surplus property table to the pending transfer table so that it will not be listed on a pending transfer and in the states surplus at the same time. On the flip side, if a transfer falls through I'd like that record to repopulate in the surplus inventory again.

View 2 Replies View Related

Moving Entries From One Table To Another

Jun 12, 2006

So I have 2 tables, the first is for "open" orders (where entries get edited changed and deleted), and the Second is for "finished" orders (where once an order is completed it should move from the open orders table to the finshed one where it will no change and will remain for futre reference)

I need help with the transfering part of this problem. I would ideally like to make a form that allows you to pull up the info for the open order then edit it to finally add the finished order to the other table. Im not sure where to start on this one.

View 3 Replies View Related

Moving Data From One Table To Another

Aug 21, 2006

Hi there,

I have a simple database with a form that displays the contents of a table called Products. I want to be able to delete items from Products but these should be move into ProductsArchive table and I will then create a seperate form to view Products that have now been removed but were once currently live if that makes sense?

I would like to write some code that on the form when the user clicks on the delete button it will just move the data relating to that record into the ProductsArchive table.

Can anyone help?

View 3 Replies View Related

Moving Fields To New Table

Feb 21, 2007

Hey guys,

I'm trying to move a group of fields to a new table. I want the data to follow it. Is there an easy way to do this?

View 5 Replies View Related

Moving A Record From One Table To Another

Oct 24, 2005

I have a database of assets.

For example a computer will have an asset .

This database will show the asset, where it is, what it is and who its with .
It will display this on a form.

When this asset gets given to someone else i want a button on the form which displays the assets current data to be clicked and for that info to be moved from the asset current table into the asset history table.

any idea what vb code would do this?

View 1 Replies View Related

Moving A Record From One Table To Another

Oct 24, 2005

Database is an asset register.

I have a table called assetcurrent

It displays the asset and where it is, who its with and what it is.

I want a button on the form which when clicked will move the record from the table assetcurrent into another table called asset history.

Any ideas?

View 14 Replies View Related

Moving Fields From One Table To Another

Mar 28, 2015

I am currently working on updating a database that I created four years ago for a commission record

there are the tables

table 1:

product ID
Carrier Code
Type
State Available
Updated

table 2:

Product ID
Product name
Sub-name
Street Comp
GA Comp

After refreshing my creation, I realized that Product name and sub-name from table 2 should be going to table 1.. How can I move those two fields from table 2 to table 1 without mess up the data?

View 2 Replies View Related

Newbie Help!!! Moving Record To Another Table....

Jan 10, 2005

Quick Scenrio:

I have a current employee's table and Retired/Resigned table, when an employee either retires, resigns or gets fired, i want to be able by the click of a switch or check box of some sort to move that record to the retired table. Your input is greatly apprectiated....

Eddie..

View 4 Replies View Related

Moving New Table To Back-end And Relink It

Jul 25, 2013

I created my database a few months ago and split the database into a front and back end. I recently added a new table on the front end. How can I move this table to the back end and re-link it?

View 3 Replies View Related

Inserting Or Moving A Record To A Different Position In The Table

Oct 14, 2005

Hi,
With a table in open view can a record be moved to a different position, i'm using access 2003. Also is there any way to sort besides ascending or descending?
I've got a lot of tables to make and if I forget a single column/field and have to add it later (like I have done all ready numerious times) I'm almost having to recreate the table again in order to have the field fit in the correct spot in the table. These tables are bound to combo boxes so its important every thing is grouped for easy choosing.

Thanks--All help will be very appreciated

View 6 Replies View Related

Tables :: Moving Data From One Table To The Other Via Yes / No Boxes?

Jul 5, 2013

I have two tables;

Parts
Sold Parts

Now what I am trying to get to happen is using a YES/NO box, Say i have a "part" in the parts table when i click the YES/NO box, to have the tick to say it has been sold, I want that line to move to the Sold Parts table. is this even possible?

View 5 Replies View Related

General :: Moving Record From One Table To Another Using Inputbox

Jun 20, 2014

I am trying to get a record from tbl_new_accounts to tbl_closed_accounts, based on the number entered in a input box.

Code:
Dim StoreNumber As String
StoreNumber = InputBox("Please Enter The Store Number", "")
CurrentDb.Execute ("INSERT INTO Tbl_Closed_Accounts SELECT Tbl_New_Accounts.* From Tbl_New_Accounts WHERE (((Tbl_New_Accounts.Fld_Store_Number)=" & StoreNumber & "));")

View 1 Replies View Related

Modules & VBA :: Moving Record From One Table To Another - Incomplete Query Error

Sep 25, 2014

The below SQL is basically trying move a record from one table to another, the table a copies of one another and the AlphaName variable is a string.

I keep getting the incomplete query error, somethings missing but what.

Code:

strSQL = "INSERT INTO [Holding Table].* SELECT ([Import Table].* FROM [Import Table]
WHERE ([Import Table].[Alpha Name] = '" & AlphaName & "'));"

View 3 Replies View Related







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