Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 Independent Forms-Populate data from Form1 to Form2

Status
Not open for further replies.

SGTSweety

Programmer
Oct 25, 2003
24
US
Database with two tables.
Table1(Tbl1) lists survey plats with primary address.
Table2(Tbl2) lists additional addresses.
One[Tbl1]-to-many[Tbl2] relationship using PlatID as
common field.

Query1 builds list from both tables of incomplete plats
based on completion date.

Form1(Primary) datasource = Query1
Used view incomplete plats and add new records to Tbl1

Form2 (Secondary) datasource = Query1
Used to add additional address/address ranges to Tbl2

Tbl1 builds PlatID number based on user entries. If the plat affects more than 1 address range, user selects CMD button which opens Form2 on top of Form1 to add as many entries as necessary. Can Form2 default the PlatID to be that of the current PlatID showing in Form1?

I will gladly send my work for review.

Thanks,
SGT_Sweety
***********
You are what you are; aren't you?




 
In the Load event procedure of Form2:
If CurrentProject.AllForms("Form1").IsLoaded Then
Me![PlatID].DefaultValue = Forms!Form1![PlatID]
End If

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV, Thanks for your quick response. Whereas the code runs, the result in PlatID of Form2 is #error. The tip box appearing in VB Editor shows the correct value. Any ideas?

If CurrentProject.AllForms("FORM_MappingIncomplete").IsLoaded Then
Me![addPlatRef].DefaultValue = Forms! _
FORM_MappingIncomplete![incPlatRef]
End If

To all who help, thanks.

SGT_Sweety,
Confidence=not having to look over your shoulder or
not having having to worry who's looking over yours.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top