# Access VBA set value "object required"



## SLG (Feb 23, 2005)

Hi, first off i am reluctant to post actual code,
therefore i am asking to be pointed in the right direction 

I have an access database which consists of multiple tables/forms etc.

My problem is when i try set a value in VBA to a value in one of the forms it says "Object required". However i dont think there is a problem with the code.

To check if the value is working, it displays Successfully using the Msgbox() command. however when i try:

VBAVariablehere = [forms]![etc.

and then Msgbox(VBAVariablehere)

it gives the error. Ive looked for hours on google to find a solution and already loaded the second form into the VBA coder

Please Help! it will be greatly appreciated! 

Thanks in advance


----------



## SLG (Feb 23, 2005)

ok, a bit more info.

The value im trying to use is the primary key in a table (and is given by incremental autonumber).
when trying to refer to this value, (referring to the value returned by a search to locate the record), it simply doesnt work. i've tried giving the value in another form first (it displays correctly) however i cant use that value either. 

From looking at google it may be to do with permissions, however i haven't altered these.


----------



## SLG (Feb 23, 2005)

[Bump]

Nobody got any ideas? its just really frustrating as basically my whole program needs this variable to function!


----------

