dbTalk Databases Forums  

Event to make a subform run it's VBA when it goes to a new record?

comp.databases.ms-access comp.databases.ms-access


Discuss Event to make a subform run it's VBA when it goes to a new record? in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jonceramic
 
Posts: n/a

Default Event to make a subform run it's VBA when it goes to a new record? - 05-05-2011 , 10:40 AM






Hi,

I have a subform that I use in multiple places. It's data comes from
an uneditable outside source (A sharepoint list with custom
controls.) I'm using Access2003.

I'd like to update it so that, when it goes to a null record, it
displays/hides controls so I can link to the create or edit pages in
Sharepoint. Normally, a simple task for me in VBA, etc.

But, for the life of me, I can't figure out an "event" for triggering
a subform to know when it's been told to go to a new record by its
main form.

I could do this in each main form. But, the idea of tracking down
every requery and refresh I have in multiple forms seems silly... when
all I want to do is make the subform trigger itself.

My google searches have really failed on this one.

Any ideas?

Thanks,

Jon

Reply With Quote
  #2  
Old   
Jon Lewis
 
Posts: n/a

Default Re: Event to make a subform run it's VBA when it goes to a new record? - 05-05-2011 , 11:34 AM






Won't "If Me.NewRecord Then..." in the subform's On Current event work for
you?

Jon

sjonceramic" <jonceramic (AT) gmail (DOT) com> wrote

Quote:
Hi,

I have a subform that I use in multiple places. It's data comes from
an uneditable outside source (A sharepoint list with custom
controls.) I'm using Access2003.

I'd like to update it so that, when it goes to a null record, it
displays/hides controls so I can link to the create or edit pages in
Sharepoint. Normally, a simple task for me in VBA, etc.

But, for the life of me, I can't figure out an "event" for triggering
a subform to know when it's been told to go to a new record by its
main form.

I could do this in each main form. But, the idea of tracking down
every requery and refresh I have in multiple forms seems silly... when
all I want to do is make the subform trigger itself.

My google searches have really failed on this one.

Any ideas?

Thanks,

Jon

Reply With Quote
  #3  
Old   
Salad
 
Posts: n/a

Default Re: Event to make a subform run it's VBA when it goes to a new record? - 05-05-2011 , 12:36 PM



jonceramic wrote:

Quote:
Hi,

I have a subform that I use in multiple places. It's data comes from
an uneditable outside source (A sharepoint list with custom
controls.) I'm using Access2003.

I'd like to update it so that, when it goes to a null record, it
displays/hides controls so I can link to the create or edit pages in
Sharepoint. Normally, a simple task for me in VBA, etc.

But, for the life of me, I can't figure out an "event" for triggering
a subform to know when it's been told to go to a new record by its
main form.

I could do this in each main form. But, the idea of tracking down
every requery and refresh I have in multiple forms seems silly... when
all I want to do is make the subform trigger itself.

My google searches have really failed on this one.

Any ideas?

Thanks,

Jon
Would the OnCurrent even of the MainForm work?

Reply With Quote
  #4  
Old   
jonceramic
 
Posts: n/a

Default Re: Event to make a subform run it's VBA when it goes to a new record? - 05-05-2011 , 02:09 PM



On May 5, 11:34*am, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com>
wrote:
Quote:
Won't "If Me.NewRecord Then..." in the subform's On Current event work for
you?

Jon

sjonceramic" <joncera... (AT) gmail (DOT) com> wrote in message

news:41c93940-77ce-489f-84f0-3eb46392749d (AT) j13g2000pro (DOT) googlegroups.com...



Hi,

I have a subform that I use in multiple places. *It's data comes from
an uneditable outside source (A sharepoint list with custom
controls.) *I'm using Access2003.

I'd like to update it so that, when it goes to a null record, it
displays/hides controls so I can link to the create or edit pages in
Sharepoint. *Normally, a simple task for me in VBA, etc.

But, for the life of me, I can't figure out an "event" for triggering
a subform to know when it's been told to go to a new record by its
main form.

I could do this in each main form. *But, the idea of tracking down
every requery and refresh I have in multiple forms seems silly... when
all I want to do is make the subform trigger itself.

My google searches have really failed on this one.

Any ideas?

Thanks,

Jon- Hide quoted text -

- Show quoted text -
I think Jon's got it for me on the OnCurrent Event of the subform.
That triggers for SubForm VBA whenever I change something on my
MainForm.

Although, the "if" doesn't help.... it gives it multiple "current"
triggers when I debug.print it. Actually a good thing, it's helping
because it actually then is helping me debug why this particular form
keeps triggering itself for refreshes.

I'll put my next question in a separate post.

Thanks Jon and Salad! How did I miss OnCurrent? lol

Jon

Reply With Quote
  #5  
Old   
jonceramic
 
Posts: n/a

Default Re: Event to make a subform run it's VBA when it goes to a new record? - 05-05-2011 , 02:41 PM



On May 5, 2:09*pm, jonceramic <joncera... (AT) gmail (DOT) com> wrote:
Quote:
On May 5, 11:34*am, "Jon Lewis" <jon.le... (AT) cutthespambtinternet (DOT) com
wrote:





Won't "If Me.NewRecord Then..." in the subform's On Current event work for
you?

Jon

sjonceramic" <joncera... (AT) gmail (DOT) com> wrote in message

news:41c93940-77ce-489f-84f0-3eb46392749d (AT) j13g2000pro (DOT) googlegroups.com....

Hi,

I have a subform that I use in multiple places. *It's data comes from
an uneditable outside source (A sharepoint list with custom
controls.) *I'm using Access2003.

I'd like to update it so that, when it goes to a null record, it
displays/hides controls so I can link to the create or edit pages in
Sharepoint. *Normally, a simple task for me in VBA, etc.

But, for the life of me, I can't figure out an "event" for triggering
a subform to know when it's been told to go to a new record by its
main form.

I could do this in each main form. *But, the idea of tracking down
every requery and refresh I have in multiple forms seems silly... when
all I want to do is make the subform trigger itself.

My google searches have really failed on this one.

Any ideas?

Thanks,

Jon- Hide quoted text -

- Show quoted text -

I think Jon's got it for me on the OnCurrent Event of the subform.
That triggers for SubForm VBA whenever I change something on my
MainForm.

Although, the "if" doesn't help.... it gives it multiple "current"
triggers when I debug.print it. *Actually a good thing, it's helping
because it actually then is helping me debug why this particular form
keeps triggering itself for refreshes.

I'll put my next question in a separate post.

Thanks Jon and Salad! *How did I miss OnCurrent? *lol

Jon- Hide quoted text -

- Show quoted text -
BTW, I can get the "if" part based on me.newrecord to work on some
test subforms without a bunch of requeries and refreshes. So, I think
it has something to do with some rogue event code on a few of my
forms.

Thanks,

Jon

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.