Populate Subform Field when Open with a Subform Field (1 Viewer)

gstreichan

Registered User.
Local time
Today, 20:34
Joined
Apr 1, 2014
Messages
28
Need your help, please!
I have a form called frm002_PAF_MonitoringMAIN and on this form I have a subform called frm002_PAF_Monitoring. The subform has a button to another form for contact details called Contact_Details. The Contact_Details form opens with the details of the person who I have selected on frm002_PAF_Monitoring. There are some fields on frm002_PAF_Monitoring that I would like to be populated on Contact_Details when opened, like FirstName and LastName. How can I do it?
I have tried on afterupdate event on Contact_Details below but those don't work:
Me!FirstName=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me!FirstName=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_Monitoring]![FirstName]
Me![FirstName].Value=[Forms]![frm002_PAF_MonitoringMAIN]![frm002_PAF_Monitoring]![FirstName]

Please help me. Thank you in advance.
 

vbaInet

AWF VIP
Local time
Today, 19:34
Joined
Jan 22, 2010
Messages
26,374
You carry on those details immediately after opening the form.

Why are you needing to pass the First and Last Name field values anyway? It sounds like a normalisation problem.
 

gstreichan

Registered User.
Local time
Today, 20:34
Joined
Apr 1, 2014
Messages
28
Hello vbaInet,

It is working. This is what happened.
The database has a main table, which has all details of the employee, except contact details. The contact details table is a new table that I was asked to implement. So I have entered a button on a subform for the contact details and on the main form there is a combo for searching the person through the employee position, we can have more than 1 employee, the reason why the button is on the subform.
I want to populate the firstname and lastname to the contact_details when opening as the contact_details is in blank, new table.
So I have the form frm002_PAF_MonitoringMAIN, subform frm002_PAF_Monitoring, which has a button to Contact_Details form, as it is opened through the subform and it remains open, I want the firstname and lastname from subform frm002_PAF_Monitoring to be populated on Contact_Details... The Contact_Details form already opens the form with the same entry and uique position of the employee on the subform frm002_PAF_Monitoring... Can you help with that?
 

vbaInet

AWF VIP
Local time
Today, 19:34
Joined
Jan 22, 2010
Messages
26,374
Let me see the fields of the Main table and the Contact Details table.
 

gstreichan

Registered User.
Local time
Today, 20:34
Joined
Apr 1, 2014
Messages
28
MAIN TABLE
01_Zoom
02_Service
03_ManningListPos_#
04_JobTitle
05_HO_MOBDate
06_HO_DemobDate
07_BC/ML_MobDate
07a_HistoricalMobDates
08_BC/ML_DemobDate
09_PAF_#
10_ReceptionDate
11_EntityHVEorExpat
12_HistoricalEntity
13_PayCat
14_Last Name
14a_FirstName
14b_Gender
15_Agency
16_EstimatedMobDate
17_LastStepInProcess
18_Remarks/Historical
19_ActionBy
20_Nationality
21_OriginalBarChartEntity
22_OriginalBarChartPayCat
23_EffectiveEntity
24_EffectivePayCat
25_OriginalScheduleMobDate
26_OriginalScheduleDemobDate
27_AssignmentStatus
28_EmploymentConditions
29_Accommodation
30_Remarks_ReplacExtPosChange
31_CandidateAvailable
32_From
33_To
34_Rate
34a_Currency
35_EmploymentConditions
36_SentToAdministration
37_RecvFromAdministration
38_SentToCostControl
39_RecvFromCostControl
40_SentToSiteManager
41_RecvFromSiteManager
42_SentToConstDepDirector
43_ReceivedFromConstDepDirector
44_SentToProjectManager
45_RecvFromProjectManager
46_SentToUNDEFINED1
47_RecvFromUNDEFINED1
48_SentToUNDEFINED2
49_RecvFromUNDEFINED2
50_Location
51_PAFToBeIssued
52_PAFIssued
53_Picture
54_CVAttachment

Contact Details Table
CONTACT DETAILS
ID
Company
Last Name
First Name
E-mail Address
Job Title
Business Phone
Home Phone
Mobile Phone
Fax Number
Address
City
State/Province
ZIP/Postal Code
Country/Region
CV_Attachment
Notes
Attachments
PAF_#
 

vbaInet

AWF VIP
Local time
Today, 19:34
Joined
Jan 22, 2010
Messages
26,374
It's fair to say that my concern about your table not being properly normalised is actually true. Do you know about normalisation?

Do the field names for the first table actually contain a numerical prefix?

What fields relate the main table to the contact details table?
 

gstreichan

Registered User.
Local time
Today, 20:34
Joined
Apr 1, 2014
Messages
28
Yes, I have done this way because construction extracts the data to excel for creating the dashboard. As their spreadsheet has a very illustrated header, I have numbered their dashboard spreadsheet and also the table in access, so when they copy from access and paste on the excel spreadsheet, under the header, they can easily verify if all columns have been pasted in correct sequence... that's the indiana jones solution I found.
I only want the Contact_Details fields First Name and Last Name to be populated with 14a_FirstName and 14_Last Name, those are the 2...
 

vbaInet

AWF VIP
Local time
Today, 19:34
Joined
Jan 22, 2010
Messages
26,374
... that's the indiana jones solution I found.
... that's why Indiana Jones didn't end up being a Developer ;)

You're going about it the wrong way. Before you proceed I would advise that you create a new thread in the "Tables" forum asking for help with normalisation. Once you've straightened this all out you'll find that all what you're trying to do won't be necessary any longer.
 

vbaInet

AWF VIP
Local time
Today, 19:34
Joined
Jan 22, 2010
Messages
26,374
Best thing to do is to ask for help in that forum. Someone will be able to guide you as go along and you'll be given all the necessary links to read up on.
 

GinaWhipp

AWF VIP
Local time
Today, 14:34
Joined
Jun 21, 2011
Messages
5,899
Hmm, if this is the new thread you directed me to then you need to heed vbaInet's advice because those Tables are... ahem, a mess. Now, there might be a legitimate reason for doing it like that and if there is please explain...
 

Users who are viewing this thread

Top Bottom