Me.Value

R

Revned

i have a cmdPlaceHolder button with this code
Private Sub PlaceOrder_Click()
'Open my Order Forms and close Customer Book form and add information to
this form
DoCmd.OpenForm "Order Forms", acNormal, , , acFormAdd
'copy the CustomerID to Order Form
Forms![Order Forms]![Text13].Value = Me.Text13.Value
Forms![Order Forms]![Text15].Value = Me.Text15.Value
'set cursor to Invoice No
Forms![Order Forms]![Text63].SetFocus
'close cutomer book and open order forms acAdd
DoCmd.Close acForm, "Customer", acSaveYes
End Sub

this code will copy to my control from Customer form to Order Forms
what else di need to add to this code that once i click on Place Holder
button all information that just added will go directly to bound table
tblCustomer

thank you
 
G

Graham Mandeno

Hi Revned

First, I *strongly* recommend that you rename your controls after creating
them, and don't leave them with their default names.

Me.Text63 means nothing.
Me.txtInvoiceNum has some chance of being understood.

I'm inferring that this code is in the module of the form named "Customer"
and that the form is bound to tblCustomer. If so, then you don't need to do
anything to save the customer record. It will happen automatically
(provided there is no error) when you close the form (DoCmd.Close). You
don't need acSaveYes either. This causes the *design* of the form to be
saved, not the data. The data will look after itself.

If you want to force the data to be saved without either closing the form or
moving to another record, then use Me.Dirty = False.
 
R

Revned

thank you very much Graham Maderno
i really appreciate your time and consideration

Graham Mandeno said:
Hi Revned

First, I *strongly* recommend that you rename your controls after creating
them, and don't leave them with their default names.

Me.Text63 means nothing.
Me.txtInvoiceNum has some chance of being understood.

I'm inferring that this code is in the module of the form named "Customer"
and that the form is bound to tblCustomer. If so, then you don't need to do
anything to save the customer record. It will happen automatically
(provided there is no error) when you close the form (DoCmd.Close). You
don't need acSaveYes either. This causes the *design* of the form to be
saved, not the data. The data will look after itself.

If you want to force the data to be saved without either closing the form or
moving to another record, then use Me.Dirty = False.

--
Good Luck :)

Graham Mandeno [Access MVP]
Auckland, New Zealand


Revned said:
i have a cmdPlaceHolder button with this code
Private Sub PlaceOrder_Click()
'Open my Order Forms and close Customer Book form and add information to
this form
DoCmd.OpenForm "Order Forms", acNormal, , , acFormAdd
'copy the CustomerID to Order Form
Forms![Order Forms]![Text13].Value = Me.Text13.Value
Forms![Order Forms]![Text15].Value = Me.Text15.Value
'set cursor to Invoice No
Forms![Order Forms]![Text63].SetFocus
'close cutomer book and open order forms acAdd
DoCmd.Close acForm, "Customer", acSaveYes
End Sub

this code will copy to my control from Customer form to Order Forms
what else di need to add to this code that once i click on Place Holder
button all information that just added will go directly to bound table
tblCustomer

thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top