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

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
 
D

Douglas J. Steele

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.
 
L

LJG

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
 

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