Event Procedure

  • Thread starter Mellissa via AccessMonster.com
  • Start date
M

Mellissa via AccessMonster.com

Hi,

I am using Access 2003.

I am trying to add an Event Procedure in the AfterUpdate Property on my main
Form

Basically, I have a field called "Complete" and it is a Yes/No check box on
my main form.

Then, I have a field called "FundsIn" and it is a Yes/No check box on my
SubForm.

I have both check boxes because my team works on Transfering accounts from
Fund Companies to us and we may be transferring an account from CIG and from
AIC but they may or may not be transferred at the same time. Therefore, I
want our processors to have the option to say either AIC funds are in,
FundsIn = True but CIG funds are not in, FundsIn = False OR both funds are in
- Complete = True

Hence, I am trying to do something like this...

Private Sub IsSelected_AfterUpdate()
If Me.Complete = True Then
Me.FundsIn = True
Else
Me.FundsIn = Null
End If
End Sub

However, I am getting an error message "Compile Error: Method or Data Not
Found" And I believe that I am getting this error because the Complete
Indicator is on my main form and my FundsIn Indicator is on my SubForm. Both
Forms have their own Query to eliminate the "Criteria" questions from
repeating themselves.

Is there any way that I can get around this compile error to complete this
Event Procedure?

Thank you so much in advance ;)

Mellissa
 
C

Carl Rapson

Mellissa via AccessMonster.com said:
Hi,

I am using Access 2003.

I am trying to add an Event Procedure in the AfterUpdate Property on my
main
Form

Basically, I have a field called "Complete" and it is a Yes/No check box
on
my main form.

Then, I have a field called "FundsIn" and it is a Yes/No check box on my
SubForm.

I have both check boxes because my team works on Transfering accounts from
Fund Companies to us and we may be transferring an account from CIG and
from
AIC but they may or may not be transferred at the same time. Therefore, I
want our processors to have the option to say either AIC funds are in,
FundsIn = True but CIG funds are not in, FundsIn = False OR both funds are
in
- Complete = True

Hence, I am trying to do something like this...

Private Sub IsSelected_AfterUpdate()
If Me.Complete = True Then
Me.FundsIn = True
Else
Me.FundsIn = Null
End If
End Sub

However, I am getting an error message "Compile Error: Method or Data Not
Found" And I believe that I am getting this error because the Complete
Indicator is on my main form and my FundsIn Indicator is on my SubForm.
Both
Forms have their own Query to eliminate the "Criteria" questions from
repeating themselves.

Is there any way that I can get around this compile error to complete this
Event Procedure?

Thank you so much in advance ;)

Mellissa

The FundsIn control doesn't exist in your main form. That's the reason for
the compile error. You'll need to qualify FundsIn with the name of the
subform as well:

Me.<subformname>.Form.FundsIn = True

Be sure to use the name of the subform control, not the name of the subform
that the control is based on. I'm assuming, of course, that this code is
running in an event in the main form, not the subform.

Carl Rapson
 
M

Mellissa via AccessMonster.com

Hi Carl,

Thank you. Silly question, where to I find the name of the SubForm Control?

Thanks,
Mellissa

Carl said:
[quoted text clipped - 43 lines]

The FundsIn control doesn't exist in your main form. That's the reason for
the compile error. You'll need to qualify FundsIn with the name of the
subform as well:

Me.<subformname>.Form.FundsIn = True

Be sure to use the name of the subform control, not the name of the subform
that the control is based on. I'm assuming, of course, that this code is
running in an event in the main form, not the subform.

Carl Rapson
 
C

Carl Rapson

The Name property on the Other tab of the subform control's Properties
window. Click on the subform control, open the Properties window, click on
the Other tab, it should be the first field.

Carl Rapson

Mellissa via AccessMonster.com said:
Hi Carl,

Thank you. Silly question, where to I find the name of the SubForm
Control?

Thanks,
Mellissa

Carl said:
[quoted text clipped - 43 lines]

The FundsIn control doesn't exist in your main form. That's the reason for
the compile error. You'll need to qualify FundsIn with the name of the
subform as well:

Me.<subformname>.Form.FundsIn = True

Be sure to use the name of the subform control, not the name of the
subform
that the control is based on. I'm assuming, of course, that this code is
running in an event in the main form, not the subform.

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top