Populate second form from combo box

  • Thread starter Thread starter eon
  • Start date Start date
E

eon

Main form is based on Units Table.
UnitID PK
UnitNumber
SquareFeet
Rent
The combobox on UnitsForm shows the UnitNumber and populates the
SquareFeet and Rent txtboxes when a unit is selected.

Second Form is based on Leases Table.
LeaseID PK
UnitID FK
LeaseStart
LeaseEnd

Units is one of One to many.

I want to use a command button to open LeaseForm and show the
UnitNumber and Rent selected in Units Form. If no current Lease is
associated with the Unit, then open to new record.

Does anyone have a suggestion?

Thanks
 
In the OnLoad or OnOpen event of the form you want to display the ne
record if no lease is present enter this code...I am going to assum
that if there is no lease the words 'No Lease' will be displayed in
the textbox I am going to call txtLease because I dont know what yo
are calling it.

If txtLease.Value = "No Lease" Then
DoCmd.GoToRecord , , acNewRecord
EndI
 
Back
Top