Joining Fields to a sub-form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All
I am extremely new to programming so please excuse me.
I have numerous fields on a form ie Client Name, Street Address, Suburb,
Post Code etc and I would like these fields to automatically fill in to a
sub-form when client name is selected so it can be merged to different types
of documents (on the subform) when selected. Is this possible and if so how
do I go about it?
Your help is appreciated many Thanks in Advance
 
Kez,

You do not have to put Client related field on you subform, if they are
already present on the parent form. All you need to do from within the
subform to reference those field is prefix them with Parent reference:

Parent![Client Name], etc.

HTH
 
Sorry I haven't explained myself very well.

My form is a linked form (not sub-form, sorry). I want the form to auto
fill in the address fields when client field is completed instead of having
to type it in manually or select from a drop down list (over 3,000 clients as
it takes forever).

Thanks again

Sergey Poberezovskiy said:
Kez,

You do not have to put Client related field on you subform, if they are
already present on the parent form. All you need to do from within the
subform to reference those field is prefix them with Parent reference:

Parent![Client Name], etc.

HTH

Kez said:
Hi All
I am extremely new to programming so please excuse me.
I have numerous fields on a form ie Client Name, Street Address, Suburb,
Post Code etc and I would like these fields to automatically fill in to a
sub-form when client name is selected so it can be merged to different types
of documents (on the subform) when selected. Is this possible and if so how
do I go about it?
Your help is appreciated many Thanks in Advance
 
A few ways to accomplish that:
- you could use DLookUp function on client related fields' ControlSource:
= DLookUp("Client Name", "tblClients", "[Client ID]=" & [Client ID]), for
example, or
- populate client related fields in code on, say Client ID AfterUpdate event
(with validating ID on BeforeUpdate)
if you use DAO, for example:

With CurrentDb.OpenRecordset("Select * From tblClients Where [Client ID]=" &
[Client ID], dbOpenForwardOnly)
If .EOF Then
' Should not happen if validated properly (unless new record)
Else
Me![Client Name] = ![Client Name]
...
End If
.Close()
End With

HTH
Kez said:
Sorry I haven't explained myself very well.

My form is a linked form (not sub-form, sorry). I want the form to auto
fill in the address fields when client field is completed instead of having
to type it in manually or select from a drop down list (over 3,000 clients as
it takes forever).

Thanks again

Sergey Poberezovskiy said:
Kez,

You do not have to put Client related field on you subform, if they are
already present on the parent form. All you need to do from within the
subform to reference those field is prefix them with Parent reference:

Parent![Client Name], etc.

HTH

Kez said:
Hi All
I am extremely new to programming so please excuse me.
I have numerous fields on a form ie Client Name, Street Address, Suburb,
Post Code etc and I would like these fields to automatically fill in to a
sub-form when client name is selected so it can be merged to different types
of documents (on the subform) when selected. Is this possible and if so how
do I go about it?
Your help is appreciated many Thanks in Advance
 
Back
Top