Question You can't assign a value to this object error when using Windows 7 64 bit

micalo

New member
Local time
Today, 12:26
Joined
May 18, 2011
Messages
5
Hi ,

I have a access 2007 database that is running on windows 7 32bit, recently we upgraded or pc and now have 64 bit version of windows 7 with access 2007 32 bit. After the upgrade i not get the following error

Err number -2147352567
You can't assign a value to this object

This occurs when I am trying to add a new record on a form from another form

the code is as follows, it is failing on the second line

DoCmd.GoToRecord , , acNewRec
Me.txt_SITE_ID = CLng(sArgs(1))

txt_SITE_ID is a text box control and it does have a field in the control source property.

This all works though on windows 7 32bit. does anyone have an idea how to resolve this, i should mention also half of us are still on 32bit.
 
There are many people running access on Win 7 64 bit, as I am.
I'm not aware of any thing in particular in a change from 32 to 64 bit that would cause this error.

If you create a new database and import all into the new database does that fix it?
 
Hi Jeanette,

thanks for you answer, it an odd problem as the other forms all work. tried you solution but I came across another error. When i import it doesnt give me an option to import queries,eveything else went across though it looks like. So I tried to manually copy/paste the queries which have another error saying it cant find the object. I then tried with one query and made sure it was not dependant on any other queries and got the same error. any ideas
 
Hi Boblarson,

thanks for you reply. Yes it is using ado 2.7 , i downloaded the TLB files and registered mentioned in the article but this didn't help.

I did find however that the recordsource ="" when I debug. that is wrong as it should be = "CONTACTS".

tried setting the recordsource but after setting it, it still blank. I should point out I am new to access. Does that help narrow it down?
 
i forgot to mention that the recordsource is set already at design time. but when it does form load it does not have a recordsource
 
If you are using any Windows API code or dll's you need to declare them with the PtrSafe keyword.

As for your record source being blank - then somewhere your code is out of scope and it isn't getting to where it needs to be.
 
Hi Bob,

Thanks, 1 dll was causing an issue on another form and this helped. This form continues to be an issue though, I think looking at how I call the form may help

trying to open Contact_Detail and add a new record

Set fiP.Form = Forms!main_screen!Contact_Detail.Form
Set fiPP.Form = Forms!main_screen
Set ctl = Forms!main_screen.Contact_Detail
sArgValues = "3," & CStr(Me.SITE_ID) & "," & Me.SITE & "," & Me.txt_NAME
DoCmd.OpenForm "Contact_Detail", acNormal, , , acFormAdd, acHidden, sArgValues
Set fiNew.Form = Forms("Contact_Detail")

I noticed that in the immediate windows this give a recordsource

? Form_Main_Screen.Contact_Detail.Form.RecordSource

returns
dbo.QRY_CONTACT_DETAILS

and

when it loads the form

? me.recordsource

returns nothing

I am calling the form wrong or is there a better way.
 

Users who are viewing this thread

Back
Top Bottom