A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Populate second form from combo box



 
 
Thread Tools Display Modes
  #1  
Old May 19th, 2004, 06:48 PM
eon
external usenet poster
 
Posts: n/a
Default Populate second form from combo box

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
  #2  
Old May 20th, 2004, 02:55 PM
Shiner452
external usenet poster
 
Posts: n/a
Default Populate second form from combo box


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

If txtLease.Value = "No Lease" Then
DoCmd.GoToRecord , , acNewRecord
EndIf


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.