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

Pulling information from one table into another 1

Status
Not open for further replies.

stacy0966

Programmer
Apr 27, 2004
35
US
Hello,

I have two forms I am using to enter information about meals. It's an expense report. The first form is called perdiem and has four fields (i.e. breakfast, lunch, dinner, tips). It only has one record. The amount for breakfast, lunch, dinner and tips. The second form is called ExpenseReport. This is where I enter information about an employee's meals. The form looks something like this:

Emp Name, BreakfastAmt, LunchAmt, DinnerAmt, TipAmt.


Between emp name and breakfast I have a check box. When clicked
it pulls the breakfast, lunch, dinner and tip amounts from the perdiem table/form. It's works fine as long as the perdiem form is open but if the perdiem form is closed I get this error message "Microsoft can't find the form perdiem referred to in macro or expression or visual basic code. I want this to work without having to open the perdiem form.

The code I'm using is
Me.SunBreakfast = [Forms]![perdiem]![Breakfast]
Any thoughts would be appreciated.

Thanks

Stacy
 
try

Me.SunBreakfast = dlookup("Breakfast","perdiem")


 
DLookup("tips", "perdiem") Worked GREAT. Thanks for the tip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top