Hi Dennis,
You can do it with code like the following.
Private Sub Form_BeforeUpdate(Cancel As Integer)
If IsNull(Me.Controls("PhoneNum")) Then
Me.Controls("PhoneNum") = Me.Parent.SwitchBoard
End If
End Sub
where "PhoneNum" is the name of the field in the SubForm
and Switchboard is the name of the field in the MainForm.
Hope that helps.
By the way, there was a useful file in the GroupFiles
that shows how to reference Forms from subForms and
vice versa but I can't find it. I wil try to send you
a copy that I have.
Regards, Clive.
--- In MS_Access_Professionals@yahoogroups.com, Dennis Davidsson <dennisdavidsson@...> wrote:
>
>
> Hello,
>
> I have form called Adressregister, in which I register misc. address information for my customer companies.
> This form has a subform called Kontaktpersoner, in which I register misc. information for each contact person belonging to the company.
> Among the address information that I register in the main form is e.g. the telephone number to the switchboard of the company.
> But also on the subform Kontaktpersoner I can register the specific telephone extension to the contact person.
> Now, when I register a new contact person I want the telephone number in the main form Adressregister to be automatically filled in in the telephone number also in the subform as a default.
> How can I accomplish this?
>
> Kindly regards
> Dennis Davidsson
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
Sabtu, 28 Januari 2012
[MS_AccessPros] Re: Autofill in subform
__._,_.___
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar