dlookup help

G

Guest

I enter Patients Expenses and I am trying to have some control on the
transactions to avoid duplicates . sometimes I get invoices with different
no. but part of the expense period is already covered by another paid invoice.

so I am trying to do the following
on the before update event of the expensestartdate

If the Expense category is "Treatment"then
lookup the prvious treatment transations for this patient and see if the
entered date here is falling in any of the previous transactions. and prompt
the user.

suppose there is one preious transaction with expense dates from
01-15/feb/07 and suppose the entered date in this transaction is any date
between 01-15/02/07 then to prompt the user.

I dont know if this can be done.
for each record there is PATIENTID.
my table name is PATIENTSMAINTABLE.
 
G

Guest

Hi mhmaid,

If you have a start date and end date then it is certainly possible, like
this:

dlookup("FIELD", "TABLE", "[PatientID] = " & me.lngPatientID & " and #" &
format(me.ENTEREDDATE, "yyyy/mm/dd") & "# between [STARTDATE] and [ENDDATE]")

Hope this helps.

Damian.
 

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

Top