Input variables into forms

jcwillette

Registered User.
Local time
Today, 04:26
Joined
Jan 19, 2009
Messages
23
I have a db that has a main form and a subform. I want to ask the user for a date that they are working on...and then have that date automatically inserted into the subform field so they don't have to continually retype it. As with my other field, I need to have them asked what checkpoint they are working on and again have that data inserted so they don't have to retype it.:confused:

Any help would be appreciated.:)

Thanks.

JC
 
Are you saying that you're going to be entering muliple records in the subform with the same date and checkpoint? You can cause data for a given control to be "carried forward" thru successive records by using the control's AfterUpdate event to set the control's Default Value. Once it's entered, each subsequent record will have the same value inserted automatically until you either change the value or close the form. I've never used it in a subform scenario, but testing shows that it does work in this situation.

Open the form your subform is based on, independently, and add this code ffor each control you want to carry forward, simply replacing YourControlName each time with the actual name of your control:

Code:
Private Sub YourControlName_AfterUpdate()
   Me.YourControlName.DefaultValue = """" & Me.YourControlName.Value & """"
End Sub
 
That seems to be working fine even though a new record is displayed with the information in it. I guess it doesn't save it if the other fields are blank which is good.

Thanks for the insite!;)

JC
 

Users who are viewing this thread

Back
Top Bottom