UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Syntax Question, Access 2013    
 
   
Hotrod1952
post Jan 10 2020, 11:46 AM
Post#1



Posts: 12
Joined: 21-November 19



I have a mainform with a continuous subform. My code is:
(where txt11 is a textbox holding a concatenated string value with values like : Cbox10 or Cbox20 etc. Txt10 is a hidden textbox on the subform.

Me.Parent.Form.Controls(Txt11) = Txt10 'set value of combo on parent form - working fine here

What in need to do next here is: call Mainform.Controls(txt11)_AfterUpdate - event here.
This post has been edited by Hotrod1952: Jan 10 2020, 11:46 AM
Go to the top of the page
 
June7
post Jan 10 2020, 12:44 PM
Post#2



Posts: 1,220
Joined: 25-January 16
From: The Great Land


What code have you tried?

This post has been edited by June7: Jan 10 2020, 12:47 PM

--------------------
Attachments Manager is below the edit post window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Go to the top of the page
 
projecttoday
post Jan 10 2020, 01:33 PM
Post#3


UtterAccess VIP
Posts: 11,589
Joined: 10-February 04
From: South Charleston, WV


You men reference a control on the mainform from the subform? You already have one of those working.

--------------------
Robert Crouser
Go to the top of the page
 
Hotrod1952
post Jan 10 2020, 01:39 PM
Post#4



Posts: 12
Joined: 21-November 19



I want to:

Call Me.Parent.Form.Controls(Txt11)_AfterUpdate - event
Go to the top of the page
 
projecttoday
post Jan 10 2020, 01:48 PM
Post#5


UtterAccess VIP
Posts: 11,589
Joined: 10-February 04
From: South Charleston, WV


You mean you want to invoke an event on the main form from the subform? If that's the case then I think what you need to do is make a subroutine of the code which is in that event. In the event remove that code and just call the subroutine. Then you can call that subroutine from anywhere you want.

--------------------
Robert Crouser
Go to the top of the page
 
tina t
post Jan 10 2020, 02:01 PM
Post#6



Posts: 6,361
Joined: 11-November 10
From: SoCal, USA


you don't want to refer to the control itself in the code call. refer to the procedure's full name in the call. i'm not entirely sure it will work, though, calling the procedure in the parent form from within the subform's module - because the AfterUpdate event procedure is a Private Sub. try it, but if it doesn't work then you may be able to add a Public Sub to the Parent form's module, as

CODE
Public Sub CallAfterUpdateSub()

    Txt11_AfterUpdate()

End Sub

and then call the Public Sub from the subform's module, as

hth
tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 
Hotrod1952
post Jan 10 2020, 03:10 PM
Post#7



Posts: 12
Joined: 21-November 19



Struggling

Created on main form:

Public Sub AfterSubFrmUpdate()
Msgbox "test"
End Sub

Code in sub form module:
Form("PMScheduleOutput").AfterSubFrmUpdate - error 2465

and

Me.Parent.AfterSubFrmUpdate - error 2465
This post has been edited by Hotrod1952: Jan 10 2020, 03:14 PM
Go to the top of the page
 
projecttoday
post Jan 10 2020, 03:18 PM
Post#8


UtterAccess VIP
Posts: 11,589
Joined: 10-February 04
From: South Charleston, WV


I never called a subform that way. I'm not saying you can't do it that way but you should be able to put the subform in a public module and just call it by name.

--------------------
Robert Crouser
Go to the top of the page
 
Hotrod1952
post Jan 10 2020, 03:28 PM
Post#9



Posts: 12
Joined: 21-November 19




Call PMScheduleOutput.AfterSubFrmUpdate - error 424
Go to the top of the page
 
Hotrod1952
post Jan 10 2020, 03:38 PM
Post#10



Posts: 12
Joined: 21-November 19



Persistance pays off

Form_PMScheduleOutput.AfterSubFrmUpdate - works!


Thanks All!
This post has been edited by Hotrod1952: Jan 10 2020, 03:39 PM
Go to the top of the page
 
tina t
post Jan 10 2020, 04:57 PM
Post#11



Posts: 6,361
Joined: 11-November 10
From: SoCal, USA


good job working it out! and you're welcome, we're all glad to help. :) tina

--------------------
"the wheel never stops turning"
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th February 2020 - 07:13 AM