How to transfer records???

UchihaSake

God of Chocolate
Local time
Tomorrow, 03:22
Joined
Mar 13, 2009
Messages
8
Is it possible to cut a record from a table/form and paste it on to another table/form using Visual Basic??

I couldn't find it after a few hours of googling:( so i tried playing around with the code (which failed horribly:mad:)

Any help will be greatly appreciated.

Thanks,

UchihaSake
 
use an Apend Query to add it to the tableB and then a Delete Query to remove it from tableA
 
the real question is, why?

stuff like this often indicates an incorrectly designed application

what are you trying to do?
 
Thanks for the swift reply John!
But is it possible to cut and paste one record at a time?
For example i have 3 records on table A. In the form i want to click a button that will transport it to Table B and delete the record from table A.

The Delete and Append seem to add everything in my table and not the current record.

Please Help

Thanks (again),
UchihaSake
 
Well I am trying to make a system for requesting docking. Basically the ship sends an enquiry to the shipyard requesting docking space. So, first an e-mail confirming receipt is sent, afterwards in accordance to the scedule either an email saying the vessel is on the waiting-list or an email saying that dock space is available will be sent.
 
To restrict data transfer you must add a WHERE-Clause to the append query.

one way if you are using an open form is to refer to field on that form which identifie the record.

Code:
Forms!NameOfForm!NameOfField

JR
 
UchihaSake,

Gemma asked the question "Why" do you want to move them from 1 table to another.

If all you want to do is "Not see them" then that can be done with either a tick (Check Box) or code.
 
Hmm...

It keeps saying "enter perimeter values".

Is it possible to set it as the record i am currently viewing by clicking a button located on the form?

Thanks for the help,
UchihaSake
 
Last edited:
If you used my suggestion then yes the form HAS to be open when you exequte the query. Or else you get the "enter parameter" promt

JR
 
I want to move them in order to organise the records.
For example if i send a waiting list e-mail then the record should be moved form the Enquiry table to the Waiting List.
 
My form is open but it still says "enter perimeter values"

Thanks,
UchihaSake
 
Then you are doing it wrong. What dos the querystatement looks like? Did you change the formname, fieldname? Did you put the statement in the "criteriaRow" of your query?

It's difficult to advise of pure guesswork.

JR
 
Well here's the SQL code:

INSERT INTO [Waiting List] ( [Enquiry Date], [Enq No], [Vessel Name], [Length(m)], [Breadth(m)], Owner, ETA, [Agent Name], [Tel no/ e-mail], Remarks, [Type of Vessel], [Response Sent Date] )
SELECT [Enquiry Table].[Enquiry Date], [Enquiry Table].[Enq No], [Enquiry Table].[Vessel Name], [Enquiry Table].[Length (m)], [Enquiry Table].[Breadth (m)], [Enquiry Table].Owner, [Enquiry Table].ETA, [Enquiry Table].[Agent Name], [Enquiry Table].[Tel no/ e-mail], [Enquiry Table].Remarks, [Enquiry Table].[Type of Vessel], [Enquiry Table].[Response Sent Date]
FROM [Enquiry Table]
WHERE Forms!Enquiry_Form!Enq_No;

But this creates a new column called "[Forms]![Enquiry_Form]![Enq_No]" in the query where the criteria is "<>False"
 
I want to move them in order to organise the records.
For example if i send a waiting list e-mail then the record should be moved form the Enquiry table to the Waiting List.

To "Organise" the records you do not have to move them to a new table, you just need to flag them as "Waiting List" and then when you open a your FormWaitingList then then will appear.

I have attached a quickly put together example that may give you some ideas.
 

Attachments

I've got it working!!!

Thank you SOOOOOOO much for the help guys!

I appreaciate it a LOT!!! :)
 

Users who are viewing this thread

Back
Top Bottom