Hi Guys
Been around around in circles with this one, and probably (hopefully) a trivial one to solve. I have a form which generates a single number (Text41 below) from 1 to 12 (depending on Text6 on the form). The numbers generated are all correct (see 'Immediate' window below). I'm then trying to use Dlookup to convert the number to a month name (Jan-Dec) by referencing a table (tblMonths) which has 2 columns (Num and Mth), one of numbers from 1 to 12 and the other with matching month names from Jan to Dec. The criteria string (strmth below) is correct (see ''Immediate' window below) but the value returned is always "Jan" (the first record in tblMonths). If I replace the variable strmth in DLookup with the actual value (eg. "Num=8" or "Num='8'"), the month returned is then correct (August in this case). The reason for 2 different criteria strings is because I have formatted Num both as a string and as a number to see if it made any difference....it didn't! Is it something really obvious and daft I'm doing (or not doing)? Am I triggering it on the wrong event (onCurrent)?
Thanks for any advice
DDJ
Been around around in circles with this one, and probably (hopefully) a trivial one to solve. I have a form which generates a single number (Text41 below) from 1 to 12 (depending on Text6 on the form). The numbers generated are all correct (see 'Immediate' window below). I'm then trying to use Dlookup to convert the number to a month name (Jan-Dec) by referencing a table (tblMonths) which has 2 columns (Num and Mth), one of numbers from 1 to 12 and the other with matching month names from Jan to Dec. The criteria string (strmth below) is correct (see ''Immediate' window below) but the value returned is always "Jan" (the first record in tblMonths). If I replace the variable strmth in DLookup with the actual value (eg. "Num=8" or "Num='8'"), the month returned is then correct (August in this case). The reason for 2 different criteria strings is because I have formatted Num both as a string and as a number to see if it made any difference....it didn't! Is it something really obvious and daft I'm doing (or not doing)? Am I triggering it on the wrong event (onCurrent)?
Thanks for any advice
DDJ