ms-access


MS Access Syntax error


here is my code:
Text22 = DLookup("[Program_No]", "1_Supportive_Housing", "[Program_Name] = '" & Replace([Me.Program_Name], "'", "''") & "' And [BudgetYear] = " & [Me.BudgetYear])
I am not sure what is wrong with it, but it keeps giving me the following error:
Can't find the field | in your expression
I have been trying to get rid of this error but nothing works.
OnKeyPress, this event triggers. As the user writes, it should be able to lookup the value in the table and assign it to text22.

Looks like you want to reference to form fields [Me.Program_Name] & [Me.BudgetYear], but Access tries to find fields with exactly this name, including "Me." prefix. Try to remove brackets at all, or use Me.[Program_Name] and Me.[BudgetYear] instead.


Related Links

Display a count number in a Access Report into a Text Box on Access form
Long Text change to rich text still only allows 255 characters in ACCESS 2016 db
Use variable to SELECT records in a recordset
Microsoft Access 2010: ComboBox text extraction / search
“Couldn't find Instalable ISAM” VB6 Data Control to Access DB
Replace Keywords
Access Navigation Control BrowseTo "The command or action 'BrowseTo' isn't available now. Error 2046
Add a record (that does not already exist) to a table from a userform
Access 2010 report invoice total
linked table xxx is unavailable. Microsoft access cannot contact the server
Does this Dlookup have incorrect syntax?
How to combine two fields in Form to one field from Microsoft Access?
Report building from selection in datasheet
Multiple arguments IsNull function MS Access VBA
how to pass parameters to ExportWithFormatting using vbscript
Access 2010 cascading combo boxes runtime error 424

Categories

HOME
vim
log4j
path-finding
iterator
iot
sqlite3
ckeditor
serverspec
wamp
mouse
bs4
android-youtube-api
kibana-4
vifm
user-input
spring-xd
numeral.js
etl
timeout
vb.net-2010
visual-studio-cordova
pc
jsdoc
flux
dbext
amazonsellercentral
ml
sylius
jndi
fish
entitlements
filezilla
dbclient
ecto
galsim
oracle-fusion-middleware
ioio
webtest
mapbox-gl
force-layout
android-ble
restlet
event-driven
sharefile
webix-treetable
hue
sfdc
estimote
keydown
vao
cubic-spline
auto-update
upstart
promela
tizen-native-app
togetherjs
brightcove
darcs
kbuild
knpmenubundle
pillow
memory-alignment
mako
titanium-android
migradoc
watchconnectivity
cubes
nested-sets
setuptools
nxt
removechild
transmitfile
lua-5.1
netmq
ios8-today-widget
srand
prerequisites
intel-fortran
mutation-observers
arcanist
myo
unity3d-gui
valueconverter
openlaszlo
quantlib-swig
ms-project-server-2010
gridcontrol
android-screen-support
lcs
http-unit
clipper
e4x
gil
objective-c-2.0
osql
tomcat-valve
visitor-statistic
getresponsestream
nhibernate.search
asp.net-profiles
rescale
compiler-specific
virtual-functions
defensive-programming
msdev
rtml





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm