entering a record

  • Thread starter Thread starter LJG
  • Start date Start date
L

LJG

OK, have tried a few things, this one creates an orderID, however it is not
putting the contactID into field txtcontactID ?

is my code wrong?

Have checked spellings but it is not passing the contactID

Any clues?


Private Sub btnQuote_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmQuote", acNormal, "", "", acFormAdd, acWindowNormal
Forms!frmQuote!txtcontactID = contactID '.Value
Forms!frmQuote.SetFocus
End Sub

Thanks
Les
 
Private Sub btnQuote_Click()
DoCmd.OpenForm "frmQuote", , , , acFormAdd
Forms!frmQuote!txtcontactID = Forms![FormName]!contactID
End Sub

You need to enter the original form name in the [FormName]

This should work for you.
 
Hey,

Tried adding the code you suggest and despite the correct spelling of the
form name 'frmNewCustomer' the program falls over and gives an run time
error 2450 stating that the form cannot be found ?

Any ideas ?

Thanks
Les



Penguin said:
Private Sub btnQuote_Click()
DoCmd.OpenForm "frmQuote", , , , acFormAdd
Forms!frmQuote!txtcontactID = Forms![FormName]!contactID
End Sub

You need to enter the original form name in the [FormName]

This should work for you.

OK, have tried a few things, this one creates an orderID, however it is
not
putting the contactID into field txtcontactID ?

is my code wrong?

Have checked spellings but it is not passing the contactID

Any clues?


Private Sub btnQuote_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmQuote", acNormal, "", "", acFormAdd, acWindowNormal
Forms!frmQuote!txtcontactID = contactID '.Value
Forms!frmQuote.SetFocus
End Sub

Thanks
Les
 
Further to my last mail, changed the frm names around and added frmQuote,
the called form and the error cleared, it did not however add the value to
txtcontactID


Penguin said:
Private Sub btnQuote_Click()
DoCmd.OpenForm "frmQuote", , , , acFormAdd
Forms!frmQuote!txtcontactID = Forms![FormName]!contactID
End Sub

You need to enter the original form name in the [FormName]

This should work for you.

OK, have tried a few things, this one creates an orderID, however it is
not
putting the contactID into field txtcontactID ?

is my code wrong?

Have checked spellings but it is not passing the contactID

Any clues?


Private Sub btnQuote_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmQuote", acNormal, "", "", acFormAdd, acWindowNormal
Forms!frmQuote!txtcontactID = contactID '.Value
Forms!frmQuote.SetFocus
End Sub

Thanks
Les
 
First are you opening up the form and filling in the data or are you
opening up the form to a specific record?

Further to my last mail, changed the frm names around and added frmQuote,
the called form and the error cleared, it did not however add the value to
txtcontactID


Penguin said:
Private Sub btnQuote_Click()
DoCmd.OpenForm "frmQuote", , , , acFormAdd
Forms!frmQuote!txtcontactID = Forms![FormName]!contactID
End Sub

You need to enter the original form name in the [FormName]

This should work for you.

OK, have tried a few things, this one creates an orderID, however it is
not
putting the contactID into field txtcontactID ?

is my code wrong?

Have checked spellings but it is not passing the contactID

Any clues?


Private Sub btnQuote_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmQuote", acNormal, "", "", acFormAdd, acWindowNormal
Forms!frmQuote!txtcontactID = contactID '.Value
Forms!frmQuote.SetFocus
End Sub

Thanks
Les
 
Hi,

Opening the form to fill a record


Penguin said:
First are you opening up the form and filling in the data or are you
opening up the form to a specific record?

Further to my last mail, changed the frm names around and added frmQuote,
the called form and the error cleared, it did not however add the value to
txtcontactID


Penguin said:
Private Sub btnQuote_Click()
DoCmd.OpenForm "frmQuote", , , , acFormAdd
Forms!frmQuote!txtcontactID = Forms![FormName]!contactID
End Sub

You need to enter the original form name in the [FormName]

This should work for you.

On Thu, 6 Jan 2005 00:56:34 -0000, "LJG"

OK, have tried a few things, this one creates an orderID, however it is
not
putting the contactID into field txtcontactID ?

is my code wrong?

Have checked spellings but it is not passing the contactID

Any clues?


Private Sub btnQuote_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmQuote", acNormal, "", "", acFormAdd, acWindowNormal
Forms!frmQuote!txtcontactID = contactID '.Value
Forms!frmQuote.SetFocus
End Sub

Thanks
Les
 
My original example will open a form and fill data from another form.

Hi,

Opening the form to fill a record


Penguin said:
First are you opening up the form and filling in the data or are you
opening up the form to a specific record?

Further to my last mail, changed the frm names around and added frmQuote,
the called form and the error cleared, it did not however add the value to
txtcontactID


Private Sub btnQuote_Click()
DoCmd.OpenForm "frmQuote", , , , acFormAdd
Forms!frmQuote!txtcontactID = Forms![FormName]!contactID
End Sub

You need to enter the original form name in the [FormName]

This should work for you.

On Thu, 6 Jan 2005 00:56:34 -0000, "LJG"

OK, have tried a few things, this one creates an orderID, however it is
not
putting the contactID into field txtcontactID ?

is my code wrong?

Have checked spellings but it is not passing the contactID

Any clues?


Private Sub btnQuote_Click()
DoCmd.SetWarnings False
DoCmd.OpenForm "frmQuote", acNormal, "", "", acFormAdd, acWindowNormal
Forms!frmQuote!txtcontactID = contactID '.Value
Forms!frmQuote.SetFocus
End Sub

Thanks
Les
 
Back
Top