Variable behind Bound Form producing runtime error (1 Viewer)

ajetrumpet

Banned
Local time
Today, 06:17
Joined
Jun 22, 2007
Messages
5,638
folks,

I have a bound field on a form with a dynamic recordsource. when i push a button, i am populating a variable from that bound field. the code is erroring out on me on this line:
Code:
    CurrentUser = Me.userIDnum
the variable is a double in my declarations moduel, and the bound field from the table is a LONG. it is giving me a runtime error 3164, field cannot be updated. here is the recordsource for the form:
Code:
SELECT TherapyDefaults.*, CurrentUser.CurrentUser 
   FROM TherapyDefaults INNER JOIN CurrentUser ON 
      TherapyDefaults.userIDnum=CurrentUser.CurrentUser WHERE
         (((CurrentUser.CurrentUser)=CurrentUser!CurrentUser));
can anyone help me out here?
 

rainman89

I cant find the any key..
Local time
Today, 07:17
Joined
Feb 12, 2007
Messages
3,016
If you throw that in a query is it update-able or no?
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:17
Joined
Aug 30, 2003
Messages
36,118
CurrentUser is a reserved word, so I'd change the name. It thinks you're trying to change that value, which you can't.
 

ajetrumpet

Banned
Local time
Today, 06:17
Joined
Jun 22, 2007
Messages
5,638
thanks guys. i solved the problem. it turns out that there was another field in the table called currentuser, and the form was trying to read that field. i fixed it.

and by the way Paul, this is not built in a normalized way, but I have to live with it. =)
 

Users who are viewing this thread

Top Bottom