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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Command Button Opens blank record of seperate form with certain field pre-filled
I was wondering if anyone could help me out with this:
I want to add a command button to a form "TenantsForm". The command button opens up a form "PaymentsForm" but automatically goes to a blank PaymentsForm with nothing but the "TenantID" field filled in. The TenantID should automatically match the TenantsForm TenantID. If I try to use the wizard, it only takes me to pre-filled forms or a completely blank form. If anyone knows a workaround -- like adding a subform that always displays a new, blank record -- that'd work too. |
#2
|
|||
|
|||
Command Button Opens blank record of seperate form with certainfield pre-filled
Carnegie,
If it's a separate form, I think you could use code to assign the value of the TenantID, for example the Click event procedure for the command button might be like this... DoCmd.OpenForm "PaymentsForm", , , , acFormAdd Forms!PaymentsForm!TenantID = Me.TenantID Another approach would be to set the Default Value property of the TenantID control on the PaymentsForm form, to... =[Forms]![TenantsForm]![TenantID] And finally, as you suggested, a subform might be the simplest approach of all. Just set the DataEntry property to Yes for the form you will use as the suborm. Put it either directly on the TenantsForm form as a subform, or maybe even better on a Tab Control, set the Link Master Fields and Link Child Fields properties of the subform to TenantID, and away you go. -- Steve Schapel, Microsoft Access MVP Carnegie23 wrote: I was wondering if anyone could help me out with this: I want to add a command button to a form "TenantsForm". The command button opens up a form "PaymentsForm" but automatically goes to a blank PaymentsForm with nothing but the "TenantID" field filled in. The TenantID should automatically match the TenantsForm TenantID. If I try to use the wizard, it only takes me to pre-filled forms or a completely blank form. If anyone knows a workaround -- like adding a subform that always displays a new, blank record -- that'd work too. |
#3
|
|||
|
|||
Command Button Opens blank record of seperate form with certain field pre-filled
On Fri, 4 Jun 2004 17:56:03 -0700, "Carnegie23"
wrote: If anyone knows a workaround -- like adding a subform that always displays a new, blank record -- that'd work too. Add a Subform and set its Data Entry property to True. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
Thread Tools | |
Display Modes | |
|
|