Using a Form to Enter Query Parameters - Microsoft Community


hello

i having issue query , cant figure out wrong.

basically, have form {frmalpha} following fields [start date] [end date] [city]. both dates "short date format." [city] combobox.

i have query gets criteria {frmalpha}. example, have [forms]![frmalpha]![city] in criteria. in query itself, correctly labeled parameters "date w/ time" , "short text".

however, not getting results when run query. strangley enough, when remove [city] criteria query, works.

any thoughts?

sql below:

parameters [forms]![frmalpha]![city] text ( 255 ), [forms]![frmalpha]![txtstartdate] datetime, [forms]![frmalpha]![txtenddate] datetime;

 

 

select [tableone].[idnum], [tableone].[ recordeddate], [tabletwo].[city]

 

 

from [tableone] inner join [tabletwo] on [tableone].[ idnum] = [tabletwo].[ idnum]

 

 

where ((([tableone].[ recordeddate])>=[forms]![frmalpha]![txtstartdate] , ([tableone].[recordeddate])<=[forms]![frmalpha]![txtenddate]) , (([tabletwo].[ city])=[forms]![frmalpha]![txtcity]));

guess city column in tabletwo 'lookup field'.  if data type long integer number referencing primary key of cities table or similar.  combo box referenced city parameter therefore set along these lines:

rowsource:     select cityid, city cities order city;

boundcolumn:   1
columncount:    2
columnwidths:  0cm

if units of measurement imperial rather metric access automatically convert unit of last 1 inches.  important thing dimension 0 hide first column.

in query parameter declared this:

parameters [forms]![frmalpha]![city] long,


Office / Access / Windows 10 / Office 2016



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