Sub Form to Main form.

R

Robin Chapple

I have a membership form that records financial transactions in a sub
form. [frmFees]

On the main form I need to record that the fee has been paid in a
Yes/No field [FeePaid]. I have this:

Private Sub FeePaid_BeforeUpdate(Cancel As Integer)

If Forms![frmFees]![Fee] > 1 Then
[FeePaid] = True
End If

End Sub

Where am I wrong?

Thanks,

Robin Chapple
 
P

PC Datasheet

1. Subforms are not in the forms collection! They are referenced from the
mainform.
2. When a field is assigned a value in a subform, Access looks for that field
in the subform. Assignment of a value to a field in the main form must be made
through the forms collection or the parent property.

Try this code:
If Me!Fee > 1 Then
Me.Parent!FeePaid = True
End If
 
R

Robin Chapple

PC DataSheet,

Thanks, that has taught me something else. "" The more that I learn
the more I realise how much I don't know ""

Robin Chapple
 
P

PC Datasheet

Robin,

These newsgroups are a wealth of knowledge! I read them daily.

BTW, thanks for the wonderful treatment you people at au gave our people at the
Olympics there. I really enjoyed watching the Olympics on television and seeing
much of your country.

Steve
PC Datasheet
 
R

Robin Chapple

Steve,

These newsgroups are a wealth of knowledge! I read them daily.

What really impresses me is the open generosity of so many. It helps
offset the gloom of everyday news on TV.
BTW, thanks for the wonderful treatment you people at au gave our people at the
Olympics there. I really enjoyed watching the Olympics on television and seeing
much of your country.

Because you have hidden your identity I don't know who your people
were. <G> It makes no difference because all comers were treated the
same. We really are a multi cultural society.

Cheers,

Robin
 

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