Access VB code - Dlookup with multiple criteria - Microsoft Community


i have form text box want populated based on selections made in 2 other cbo boxes on form.

note - these 2 fields use waterfall type query if select specific type - show dates associated type.

so objective is to put meetdatetype associated specific meeting type , meeting date. 

there table (tblmtgdates) contain these same fields.

this dlookup created - it's not working. 

also, not sure if should on last cbo field populate afterupdate option, or if should make dlookup control source of text box.  if change date, want textbox update well.

me.text24 = dlookup("[meetdatetype]", "tblmtgdates", "[meetingdates] =" & [forms]![frmattendance]![cbomtgdate] , "[meettype] = " & [forms]![frmattendance]![cbomtgtype])

i'm sure it's of 'doh' i'm overlooking.  thank help.

you haven't provided data types of columns/fields critical domain aggregate functions. assuming meetingdates date/time , meettype numeric try:

me.text24 = dlookup("[meetdatetype]", "tblmtgdates", "[meetingdates] =#" & [forms]![frmattendance]![cbomtgdate] & "# , [meettype] = " & [forms]![frmattendance]![cbomtgtype])

if meettype text:

me.text24 = dlookup("[meetdatetype]", "tblmtgdates", "[meetingdates] =#" & [forms]![frmattendance]![cbomtgdate] & "# , [meettype] = """ & [forms]![frmattendance]![cbomtgtype] & """")



Office / Access / Windows other / Office 2010



Comments

Popular posts from this blog

Getting ErrorCode: 120018 when trying to access Microsoft account - Microsoft Community

The message was sent to a distribution list ‎(DL)‎ - Microsoft Community

Activation Error 0x8004FE93 - Microsoft Community