Dlookup Oject error

A

Amour

The problem that I have with this program is that it was developed to have
the user input (manualy) the calculated resault from excell. So now I come
along and attach a form (query) that is for calculating/displaying dates on
that same form/field (ACT_TRVL), remember now that there is other reports
attached to that field(ACT_TRVL). So it looks like there is no other way.
That is why I need to store that field (I know it is not a good programming
way but for know). So I still need to fix this problem it has to go to
ACT_TRVL(text box)

Please help and thank you!

I put this section into the load event on a form:

Private Sub Form_Load()
ACT_TRVL = DLookup("[GTotal]", "qryTravel", "[SSN] = '" & [SSN] & "'")
End Sub

Gtotal is from a query that is calculated

Here is that SQL:

SELECT DISTINCTROW
NZ([Lodging])+NZ([Taxes])+NZ([Food])+NZ([Parking])+NZ([Mileage])+NZ([Rental])+NZ([Gas])+NZ([Taxi])+NZ([Phone])+NZ([Computer])+NZ([FAX])+NZ([Metro])+NZ([Tips])+NZ([Train])
AS Stotal, NZ([Stotal])+NZ([Airfare]) AS GTotal, tblTravel.SSN,
tblTravel.Order_Num, tblTravel.LAST_NAME, tblTravel.FY,
tblTravel.TransNumber, tblTravel.TITLE, tblTravel.DateProcessed,
tblTravel.DatetoDFAS, tblTravel.Airfare, tblTravel.Lodging, tblTravel.Taxes,
tblTravel.Food, tblTravel.Parking, tblTravel.Mileage, tblTravel.MilAmt,
tblTravel.Rental, tblTravel.Gas, tblTravel.Phone, tblTravel.Computer,
tblTravel.Fax, tblTravel.Taxi, tblTravel.Metro, tblTravel.Tips,
tblTravel.Train, tblTravel.Subtotal, tblTravel.Actual_Travel,
tblTravel.TravelComments, tblTravel.DFASAMT, tblTravel.MEET_NUM
FROM tblAttendan INNER JOIN tblTravel ON (tblAttendan.MEET_NUM =
tblTravel.MEET_NUM) AND (tblAttendan.SSN = tblTravel.SSN)
WHERE (((tblTravel.MEET_NUM)=[Forms]![frmAttendanceMeeting]![Meet_num]));



ACT_TRVL(TEXT Box) is connected to TblAttendance

The problem I am having is that I get an error message and it looks like it
is only updating the firs record.

"Object doesn't support this property or method"

How do I correct this. Also I have noticed that
the field does not show up until I close the form and reopen. Also does this
for some control options within the same form

Please Help And again Thank You
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

You can't go to the specified record 0
You can't go to the specified record 4
Dlookup error 5
adding a record 0
Assigning a Value 4
Popluating a form 3
recordsource updatable 3
Popluating a form from another table 1

Top