Populate second form from combo box

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
 
S

Shiner452

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top