Data disappears from subform when entered

Tursas

New member
Local time
Tomorrow, 01:11
Joined
Apr 30, 2010
Messages
4
Hello people,

I have a problem to which I've been trying to find a solution without result.

I have two tables; tblClientGroups and tblClients

tblClientGroups has the following fields; Group ID (PK) and GroupName

tblClients has the following fields; Client ID (PK), Group ID (FK), ClName, ClSurname, ClPhone, ClAddress

I have these two tables linked and a query; qryClientInfo which is based on these two tables. It contains; Group ID, GroupName, Client ID, ClName, ClSurname and ClPhone.

I have made a subform from qryClientInfo. It works fine and shows everything what is needed but I'm unable to create a new group for an existing client. The group goes into the tblClientGroups but the group id and name doesn't show in Group ID and GroupName in the subform.

Can you help me with this?

Thanks in advance.
 
What are the Master and Child Fields for the Subform?

CHeers!
Goh
 
The data you have specified does not require a subform. Why are you using a subform what is the main form data?
 
In the mainform I have a TabControl and in the TabControl I have the subform.

I haven't set any Master or Child fields for the subform. Do I have to set them from their respective tables?
 
Master/Child Fields relate the data in the main form to the Data in the subform

Example:
Main Form is built on Query #1 from Table #1

Main Form Primary Key = MFPK which is an autonumber - this becomes a Foreign Key in the subform


TabControl; Page 1; has subform 'A'

Subform 'A' is built on Query #2 from Table #2

Subform 'A' Primary Key = SAPK which is an autonumber

AND MFFK (Main Form Foreign Key) is a field which is a number to match the Main Form Primary Key field type​

When you put the subform on the page with the wizard it automatically asks for related fields. If you do it manually or if the related fields don't work for you you can fix them in the properties of the subform.

Double Click on the top border edge of the subform when the hand shape appears. The subform properties window will open.

Find the Link Child Fields and Link Master Fields Properties
Make sure the Foreign Key in the Subform (Child Fields) and the Primary Key in the Main Form (Master Fields) are linked.

In this Example:
Child Field = MFFK
Master Field = MFPK

So if this is your problem then it should be fixed... if this is not the problem and you're trying to use a subform where it's not needed, like Bob says, we'll need more information about the issue...

Cheers!
Goh
 

Users who are viewing this thread

Back
Top Bottom