Run Time error 2448, You cannot assign a value to this object !!

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

LJG

Hi Guys, any idea why this is not working, and giving me the error?

contactID is a number field

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAdditional_Contacts"

stLinkCriteria = "[contactID]=" & Me![contactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmMainMenu.frmCustomers_edit!contactID = contactID 'value


Many thanks

Les
 
Which line of code is causing the error?

What is frmCustomers_edit: a subform on form frmMainMenu? If so, try
Forms!frmMainMenu!frmCustomers_edit.Form!contactID

See http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" for
more about how to refer to Form and Subform properties and controls.
 
Hi Douglas,

The line causing the problem is:

Forms!frmMainMenu.frmCustomers_edit!contactID = contactID 'value

When I debug and hover over the error the values are there?

will try your suggestion.

TIA

Les


Douglas J. Steele said:
Which line of code is causing the error?

What is frmCustomers_edit: a subform on form frmMainMenu? If so, try
Forms!frmMainMenu!frmCustomers_edit.Form!contactID

See http://www.mvps.org/access/forms/frm0031.htm at "The Access Web" for
more about how to refer to Form and Subform properties and controls.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



LJG said:
Hi Guys, any idea why this is not working, and giving me the error?

contactID is a number field

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmAdditional_Contacts"

stLinkCriteria = "[contactID]=" & Me![contactID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Forms!frmMainMenu.frmCustomers_edit!contactID = contactID 'value


Many thanks

Les
 
Back
Top