New Record in a form

D

Daniel

I open up one form from another, the reocord on the form
I open is based on the customer id. At the the top of the
form the customer number from the customer details form
won't show up if it is a new reocrd. I have to go into
the form, put in some details, then go back out, when I
go back in then the customer id is there. Is there anyway
to get the form to refresh as soon as I enter data, so
that cust id shows up. bewlow is the syntax of how I open
one form from another.


DoCmd.OpenForm "FrmCustPurchase", acNormal, "", "[CustID]=
[Forms]![FrmCustDetails]![CustID]", , acNormal
 
N

Nikos Yannacopoulos

Daniel,

You could try this:
DoCmd.OpenForm "FrmCustPurchase", acNormal, "", "[CustID] =
[Forms]![FrmCustDetails]![CustID]", , acNormal
If Forms!FrmCustPurchase.NewRecord Then
Forms!FrmCustPurchase!CustID = Me.CustID
End If

I.e. add a conditional part to your OpenForm code, which checks if form
FrmCustPurchase opens to a new record, and if yes then it sets the CustID
control value to the current value in form FrmCustDetails.

HTH,
Nikos
 

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