New Record for this Contact - Command Button

Abiart

Registered User.
Local time
Today, 19:49
Joined
May 17, 2006
Messages
27
Hi all,

I have a database for customer enquiries, and there is one record per product that the customer shows interest in. I want to have a button on the enquiry details form that creates a new enquiry but automatically fills in the contact details from the previous record.

Please also note that I do not wish to "normalize" this so that there is a seperate table for contacts and another for enquiries; it's much easier from our point of view to have the whole enquiry in one record, especially as this is a stand-in database before a fully integrated CRM is implemented. In any case most of the other data (e.g. product, category etc) is already stored in separate tables.

What sort of method do I need to use to create a Command Button that:

-Creates a new record
-Copies and Pastes data from selected fields into the new record?

I tried using the command button wizard for sample code but I got paste errors which were pasted into a new table, and I don't really understand the process of how this works as the Commands are numbers from a list (apparently in the macro window), which I can't find.

I'm using Access 2003 but the database file is in A2000 format. The code is below.

Thank you!


Code:
Private Sub ContactAddEnq_Click()
On Error GoTo Err_ContactAddEnq_Click


    DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
    DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append

Exit_ContactAddEnq_Click:
    Exit Sub

Err_ContactAddEnq_Click:
    MsgBox Err.Description
    Resume Exit_ContactAddEnq_Click
    
End Sub
 
Last edited:
Not sure it would work might do, but you could prob use a query to pull out every field you needed, so you would have an entry form, and then make another form and base it on query , it will update whenever ya want it to plus you could add [] to bring back certain records just a thought.
David

PS i do agree with uncle Gizmo on this one tho!!! most definetely as almost guarentee ya will come up with more problems, especially when some smart 4ss asks can you do this with it!
 

Users who are viewing this thread

Back
Top Bottom