simple form help plz... (1 Viewer)

djshongo

Registered User.
Local time
Today, 12:07
Joined
Oct 25, 2005
Messages
34
hey,
i have a form that keeps a record of my telephone enquieries at work..

i want to place a button on this form so that, whenever i have successfully dealt with a call, i can click this button and the record will go to a NEW "Logged Calls" form...

how can i achieve this?
p.s i am very new to programming etc...

thanks in advance!
johnny
 

RuralGuy

AWF VIP
Local time
Today, 06:07
Joined
Jul 2, 2005
Messages
13,826
Have you tried using the Command Button Wizard with RecordOperations>AddNewRecord?
 

djshongo

Registered User.
Local time
Today, 12:07
Joined
Oct 25, 2005
Messages
34
thanks for your reply, but i dont think you fully understand my problem

after i have recorded all the details of the call, i would like to be able to send all the records into another form called "Logged Calls". and for it to be deleted from where i originally put it..

hope this helps!

thanks again!
johnny
 

RuralGuy

AWF VIP
Local time
Today, 06:07
Joined
Jul 2, 2005
Messages
13,826
Forms do not hold data, tables do. Forms are only a window to data stored in tables. What are you really trying to accomplish?
 

dent

Registered User.
Local time
Today, 12:07
Joined
Sep 22, 2005
Messages
17
I think he is trying to have a system that shows which calls have been delt and which have not?
 

RuralGuy

AWF VIP
Local time
Today, 06:07
Joined
Jul 2, 2005
Messages
13,826
That is just a Yes/No field in the current table.
 

djshongo

Registered User.
Local time
Today, 12:07
Joined
Oct 25, 2005
Messages
34
Today 08:23 AM
dent I think he is trying to have a system that shows which calls have been delt and which have not?

yes thats it.

i currently have roughly 50 calls already stored, some have been dealt with, some still have to be dealt with.
is there any way i can filter these 50 records so that the dealt with calls are sent to another table?

like a button on my form i can press daily to filter out these calls.

thanks.
 

dent

Registered User.
Local time
Today, 12:07
Joined
Sep 22, 2005
Messages
17
you could use a yes / no field and then query using yes / no as your criterior and then base a report on the results.!! i think?
 

dent

Registered User.
Local time
Today, 12:07
Joined
Sep 22, 2005
Messages
17
try this from SKEA
I know what you are trying to do.Deleting a Record and wanting to store it in another table.Hope iam right. Ifts its not that then Remove the DELETE Query from the code below.
Make sure that the table where you want to store your deleted records is present(i called it tblDeletedRecords)
Here is the Code.Put it in your button's click event
Code:
dim i as integer
dim rsOld as DAO.Recordset
dim rsNew as DAO.Recordset
set rsNew=currentdb.openRecordSet("SELECT * FROM tblDeletedRecords")
set rsOld=currentdb.openRecordset("SELECT * FROM tblOldRecords WHERE(ID=" & YourTableID & ")")
rsNew.AddNew
For i = 0 To rsOld.Fields.Count - 1
rsNew.Fields(i).Value = rsOld.Fields(i).Value
Next
rsNew.Update

DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM tblOldRecords WHERE (ID=" & YourTableID & ")
DoCmd.SetWarnings True

rsNew.Close
rsOld.Close
Set rsNew = Nothing
Set rsOld = Nothing

Hope it will be of help.
__________________
 

dent

Registered User.
Local time
Today, 12:07
Joined
Sep 22, 2005
Messages
17
try talking to SHEA, seems to know what he is talking about
 

RuralGuy

AWF VIP
Local time
Today, 06:07
Joined
Jul 2, 2005
Messages
13,826
While viewing a code page, or after pressing <ALT> <F11> go to Tools>References and scroll down to Microsoft DAO 3.6 Object Library and put a check next to it. OK your way back to the code page and Debug>Compile.
 

neileg

AWF VIP
Local time
Today, 12:07
Joined
Dec 4, 2002
Messages
5,975
This is still the wrong way to do this. RuralGuy was right when he said you just need a field in the record that tells you if the job is closed. This could be a yes/no field or a date/time when the call closed. Your forms should be based on a query that tests for this field. Open calls will either have a no in a yes/no or have a null in the date/time depending on which you choose.
 

Users who are viewing this thread

Top Bottom