Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command Button Help

Status
Not open for further replies.

msday

Technical User
Apr 12, 2001
6
US
New to VB, I'm wondering if someone could help me create a command button on a form (which is called "EFS") that opens another form (called SPRNotes) and automatically enters data into three fields:
1. ProjectID
2. Analyst
3. Current Date

Can anyone walk me through this? I've spent hours trying to get it right, with no luck. Thanks!

Kathy

 
Kathy:

I will assume that the data for the first two fields will come from the calling form (EFS). If so, in the SPRNotes On_Open event try this code.

Me.ProjectID = Forms!EFS.ProjectID
Me.analyst = Forms!EFS.Analyst
Me.CurrentDate = Date()

This also assumes that the form EFS remains open after calling the form SPRNotes. If not, we will need to devise an alternative solution -- let me know.

This will take the values from ProjectID and Analyst on your EFS form and assign them to the equivalent fields on your SPRNotes form. Of course, change any field names to those used on the forms.

If you want the current date, just assign Date() to the date field on SPRNotes.

Hope this helps.
Larry De Laruelle
larry1de@yahoo.com

 
Larry, worked beautifully! Thank you very much for your help.

Kathy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top