Rental Properties agony

T

Thanos

Trying to set up in my "ExpensesTable" and "ExpensesForm" to automatikally
enter the property address when I enter the "PropertyID". Both fields are in
the same table and I use a list box to enter the info,in every one of them
Kal
 
R

Rod Plastow

Thanos,

Assuming that you include the property id on your expenses table why do you
want to duplicate the property address on this table?

Yes I realise that you want to see the address on expense forms and reports.
To do this simply set the record source of the relevant field to be:

=DLookUp("[PropertyAddress]","[Property]","[PropertyId] = " & Me.PropertyId)

Substitute your own names in the above. Read up on the DLookUp function in
help to get a full explanation of the syntax and arguments. My example above
assumes that [PropertyId] is numeric.

Regards,

Rod
 
T

Thanos

Rod.
Thank you for your time to awnser to my question.
You give me something to start with.
Thank you again.

Thanos
 
P

Pat Hartman \(MVP\)

DLookup() is extremely inefficient and should only be used in limited cases.
The standard solution is a query that joins the two tables. Base your forms
and reports on queries and you won't have to resort to DLookup()s.
 
R

Rod Plastow

Thanos,

Pat is, of course, right. However - dare I say it - on small to medium sized
projects you won't notice a lot of difference.

I suggested the DLookUp solution as I suspected you were fairly advanced in
your design and would not appreciate 'unravelling' what you had already done.
Futhermore it sounds as though your form is a single form that would trigger
only one DLookUp call.

Avoid repetitive DLookUp calls which is where the function becomes
inefficient compared with joined table queries. If your report is for
printing ALL expense claims then you will notice a decrease in performance -
use a joined table query for this - but if you are printing just a single
expense claim then I don't think you'll notice.

Regards,

Rod
 

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