|
-
Mar 10th, 2004, 11:00 AM
#1
Thread Starter
Addicted Member
VBA SQL Query no working
HI there,
i have set up user level security and am implementing some tracking for the users. this is part of a delete record section of code
Code:
'append user name carrying out deletion
dbs.Execute "UPDATE tblDeletions" _
& " SET tblDeletions.MyUserName = " & lpUserName & "" _
& " WHERE tbldeletions.ID = " & strRefNum & ";"
i am getting a to few parameters message for this section of code.
it seems to relate to the lpUserName which has been assigned the currently logged on users name.
ive tried messing it around a little but still end up back at the same place with teh to few parameters.
Im sure its something simple, as if i use a fixed string it works:
Code:
'append user name carrying out deletion
dbs.Execute "UPDATE tblDeletions" _
& " SET tblDeletions.MyUserName = 'LoggedOnUser'" _
& " WHERE tbldeletions.ID = " & strRefNum & ";"
TIA for any suggestions
Brian
if you fail to plan, you plan to fail
-
Mar 10th, 2004, 11:30 AM
#2
Lively Member
Where are the quotes around the username?
& " SET tblDeletions.MyUserName = '" & lpUserName & "'" _
-
Mar 10th, 2004, 11:31 AM
#3
Thread Starter
Addicted Member
Originally posted by M Owen
Where are the quotes around the username?
& " SET tblDeletions.MyUserName = '" & lpUserName & "'" _
Thank you..
sorted, i knew i was missing something..
if you fail to plan, you plan to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|