Referring to a box in subform

RonnieODIN

Registered User.
Local time
Today, 20:26
Joined
Jun 15, 2012
Messages
46
Hi all,

First some explanation to my DB:

I am listing different machines, frmListeMaskiner, for which I need to register info reg. different electrical components. Clicking a field in the machine column, "Maskine", will open a window with info about the components for the machine, frmInfoMaskine.

I am trying to make a button "Ret komponent" for whitch I would like to do the following when clicked:

I have made it identify the tab shown using select case, this works fine.
Then I would like it to collect the ID for the component, "KomponentID", in a subform to use for opening a new form, "frmKompPLC". This troubles me very much.

On the "PLC" tab the top subform is called "UnderordnetObjekt76" which is the subform I would like to collect ID from.

I am trying:

KomponentID = Me!UnderordnetObjekt76.KomponentID

Hope anyone have an idea to solve the problem.

-Ronnie
 

Attachments

Thanks a lot. The squared brackets did the trick for collecting the ID. :)

I am stil having trouble opening the new form showing the right post. I have written following code:

strKomponent = [Forms]![frmInfoMaskiner]![UnderordnetObjekt76]![KomponentID]
DoCmd.OpenForm "frmKompPLC", , , , , acDialog
DoCmd.GoToRecord acActiveDataObject, "KomponentID", acGoTo, strKomponent

The window opens fine but I am shown a new post rather than the post of the collected ID. :/
 
Last edited:

Users who are viewing this thread

Back
Top Bottom