DSum Syntax question

M

Mark Stone

I am trying to have a text box called, Placesleft, do the
following calculation:

Return the total number of bookings from
tblbookings.numberOfPeople where the holiday number = the
holiday number from frmBookings.HolidayRef

I understand I need to use the dsum but cant get the
syntax correct.

Thanks for any help given.
 
F

fredg

I am trying to have a text box called, Placesleft, do the
following calculation:

Return the total number of bookings from
tblbookings.numberOfPeople where the holiday number = the
holiday number from frmBookings.HolidayRef

I understand I need to use the dsum but cant get the
syntax correct.

Thanks for any help given.

In an unbound control on the form "frmBookings":

=DSum("[NumberOfPeople"]","tblBookings","[HolidayNumber] = " &
Me![HolidayRef])

The above assumes the HolidayNumber field is a Number datatype, i.e.
12345.
If HolidayNumber is a Text datatype, i.e. BAZ12345 or 12-345, then
use:
"[HolidayNumber] ] = '" & Me![HolidayRef] & "'")
 

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

More Dsum problems 1
need help with DSUM 3
Dsum Issues 0
dsum error message 5
DSum Problem 2
Help with DSUM syntax in a Textbox 1
DSum Question 1
Dsum in Tabbed Form 1

Top