DLOOKUP Always Returning First row of Control Table

Caleeco

Well-known Member
Joined
Jan 9, 2016
Messages
980
Office Version
  1. 2010
Platform
  1. Windows
Hello,

I have a table called BookingsT, which will represent a seating plan in my office.

I have created a front end form which will display records and allow users to enter their name to update BookingsT (I dont know how to do this yet :unsure:)

However, step 1 is reflecting the current BookingsT to the form, i read online that DLOOKUP can be used. This is the formula I created for Seat1 textbox
SQL:
=DLookUp("BookingName","BookingsT","BookingSeat=2" And "BookingDate=#" & [tBookingDate] & "#")

However, the first record is always returned. In this case, Seat 2 on 30/10/2020 should return Bill Gates.

DLOOKUP.png


What have i done wrong here?

Your help would be much appreciated
Cheers
Caleeco
 
Ah! It makes sense now that you've said it. These quotes can be tricky!

Thanks for fix!
I *always* put my criteria into a string and use that. That then also allows me to Debug.Print it to make sure the syntax is correct.
 
Upvote 0

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,223,911
Messages
6,175,322
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top