Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA ERROR: FIELD CAN NOT BE UPDATED

Status
Not open for further replies.

SGTSweety

Programmer
Oct 25, 2003
24
0
0
US
Why will line not work?

frm_MailAddr = DLookup("LocAddr", "[dbo_real_master]", "[dbo_real_master]![PIN]= [frm_PINInput]")


Attempting to populate fields on a form based on user input of property ID [frm_PINInput]. In this instance the field being populated is frm_MailAdddr. When cursor is atop this line in VB editor, a tool tip pops up with "frm_MailAddr = 3414 IVYLINK PL " which is the correct result. Code is part of "on exit event" of frm_PINInput field, but gives error FIELD CAN NOT BE UPDATED when run.

Thanks in advance for your wisdom and assistance.

"LocAddr" is field in linked table SQL database
"dbo_real_master" is linked table SQL database
"frm_PINInput" is user input
 

How about this?
Code:
frm[COLOR=red]![/color]MailAddr = DLookup("LocAddr", "[dbo_real_master]", "[dbo_real_master][COLOR=red].[/color][PIN]= [COLOR=red]' " & [/color][frm[COLOR=red]![/color]PINInput][COLOR=red] & ' [/color]")
If PIN is numeric...

Code:
frm[COLOR=red]![/color]MailAddr = DLookup("LocAddr", "[dbo_real_master]", "[dbo_real_master][COLOR=red].[/color][PIN]= [COLOR=red] " & [/color][frm[COLOR=red]![/color]PINInput])


Randy
 
Thanks...
for your time and advise,

This did it.

Steven Boyer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top