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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate a Form 3

Status
Not open for further replies.

juxtabeginner

IS-IT--Management
Oct 4, 2001
65
0
0
US
When I want to create a new record, I go to a blank form where I can enter data. What I need to have happen is:
when I go to this blank form I always want certain fields to be populated for me from another table where I keep this default information. When I'm finished adding my stuff and the form is completed, I want all of the data on the form (the default data and the data I entered) to be added to the underlying table of the form. Please show me how this is done. TIA
 
Hmm... I don't understand exactly what you're trying to do... but there are several ways of populating fields...

An easy one is to use the on_load property of the form...

Private Sub Form_Load()
Me.textboxname.DefaultValue = ""
'
' You could probably use DLookup to retrieve the
' Necessary values from your table(s)
'
'
End Sub

If you need more help, post some more information; good luck!
 
Let me explain further. I have three tables: (1) a table that contains corporate office information, although it rarely changes it does change that is why I cannot use the default value approach (2) a table that contains information about the various divisions within the corporation and (3) a table that contains information about all of the employees in the company. The three tables need to be combined to create an employee record. I created a form to accomplish this task.
I have already succeeded in adding a combo box that presents all of the divisons to select from and will populate the division fields on the form and a combo box that presents all of the employees in the company to select from and will populate the employee fields on the form. I now need to add the final piece, the corporate office information, since it is always the same I do not need to use a combo box, I just need to know how to populate the coporate office data fields in the form.
I hope this is clearer. Thanks James.
 
I find myself several pages down the list so I'm just getting back to the top and hoping for some answers. TY
 
Hi!

In the Default Value of your text boxes use the DLookUp function:

=DLookUp("YourFieldName", "YourTableName")

hth
Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top