Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Item with SetValue Macro in Subform

Status
Not open for further replies.

RandyMyers

IS-IT--Management
Apr 28, 2004
85
US
Normaly in an Access MDB I could use the statement

[Forms]![frmSystemsEdit]![frmSystemsSoftwareSub].[Form]![SWKey]

to refer to the [SWKey] field in the [frmSystemsSoftwareSub] subform on the [frmSystemsEdit] form in a SetValue macro, however in ADP it returns the following error

"The object you referenced in the Visual Basic procedure as an OLE object isn't an OLE object"

If I was referring to the field [SWKey] on the main form [frmSystemsEdit] with the statement

[Forms]![frmSystemsEdit]![SWKey]

it works fine, with no errors in either MDB or ADP.

Basically I am trying to auto set fields from combo boxes using SetValue statements. I use these all the time and on the main forms they always work fine but on subforms I get this error, while in normal Access MDBs this method always works fine.

The above statement would be in the Item arguement on the SetValue macro statement and the following statement would be in the expression box

[Forms]![frmSystemsEdit]![frmSystemsSoftwareSub].[Form]![TitleNo].[Column](1)

Please, does anybody understand why this does not work in ADP but works perfectly in MDB.

Thank you a head of time for your help!
 
Nobody wants to take a stab at this one?

I would really like to figure out why this does not work...
 
Hello Randy,

I can sortof take a stab at it. But mostly I can say that I do similart kinds of things - mostly making combo boxes that use info from a parent form in the query and it does work for me though I have to do all the coading for it right in VBA. it will not let me do it in the properties of design view.

I hope this helps a bit.

bernard
 
Bernard,

Thank you for your responce. Is there any way you could post some example code with directions for me to review?

Thank you,

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top