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

Autofill query

Status
Not open for further replies.

liltechy

Programmer
May 17, 2002
145
US
I need some help figuring out the autofill query. I have a main form with a subform. My main form is based on a table called tblEmploeeInfo. I want my subform to autofill the field Miles. The Miles should be filled in based on what data is in the PrimarySite field (main form) and the Location field (subform). I have tried to make it work but I don't know what I am doing wrong. PLEASE HELP

liltechy
 
I am not sure what you have done to accomplish this (are you using VBA, Queries, or Macro's?).

To reference a field from the main form the syntax is:

Forms.[frmMainform]![Fieldname]

When referencing a subforms fields, what I find that works is the below sytax:

Forms.[frmMainform]![frmSubform]![Fieldname]

Let me know if that points you in the right direction or not...

Joel

 
I am using queries to accomplish this. The PrimarySite field (main form) is a text box, the Location field (subform) is a combo box and the Mile field (subform) is a textbox. The subform will be based on a query. When the user enters a new employee each employee has a permanent PrimarySite. Then as the employee travel the user would then enter their travel destination (Location - subform) and the Mile field would automatically populate based on the PrimarySite and the travel destination. I have a table named tblMileage where the Miles and Location come from.

liltechy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top