Populate Automaticlly from form

  • Thread starter Thread starter JohnW
  • Start date Start date
J

JohnW

I have 2 tbls and a Form with subform
Gametbl = Main Form
GameID
Team1
Team2

SelectionTble = subForm
SelectionID
GameID
Pick
I have had no success in getting the GameID on the subform
to auto populate from the Main form GameID.I have been
useing Me.[frmSelection Subform].Form.GameID.Value =
Me.GameID.Value in the OnChange of the selection txtbx but
to no avail. Can I do this.
Thank You in Advance
 
John,

Go to the database window, open the relationships window and create a
relationship between GameID in both tables. Now open your main form in design
view and select the subform control. Open properties, go to the data tab and set
the linkmaster and linkchild properties to GameID.

You don't need your code in the OnChange event so delete it. When you make an
entry for Pick in the subform, GameID in the subform will be automaticaaly
assigned the same value as GameID in the main form. SelectionID will be
automatically assigned a value when the record is saved.


--
PC Datasheet
A Resource for Access, Excel and Word Applications
(e-mail address removed)
www.pcdatasheet.com

· Design and basic development for new applications
· Additions, Modifications and "Fixes" for existing applications
· Mentoring for do-it-yourselfers who want guidance
· Complete application design and development
· Applications Using Palm Pilot To Collect Data And
Synchronize The Data Back To Access Or Excel
 
Did you link the subform to the mainform using the Links Child Fields and
Link Master Fields properties of the subform control? Open the main form in
design view, click on subform control, open Properties, click on Data tab,
and type GameID into both properties. That should accomplish what you want.
 
Back
Top