Hello,
i am a newbie at ms access, please help
this is a code i created to be able to get the multiple users i have selected in the form. i was able to select the users in the form an select folder however i am unable to save the user name to the table. i am able to save the folder name. what should i do? -
-
Dim vtr As Variant
-
Dim frm As Form, ctl As Control
-
Set frm = Forms!Form_Assign
-
ctl = frm!listFolderUserList
-
ctr = ctl.ItemsSelected.count
-
-
If ctr > 0 Then
-
selList = ctl.ItemsSelected
-
FolderID = Me.FolderName.Value
-
For Each vtr In Me.listFolderUserList.ItemsSelected
-
usrID = Me.listFolderUserList.ItemData(vtr)
-
sqlStr = "Insert into FolderLDAP (FolderID, UserID) " _
-
+ "(" + FolderID + "," + usrID + ")"
-
CurrentDb.Execute sqlStr, dbFailOnError
-
-
Next
-
End If
-
-
please help!
thanks,
lyanne
3 1385
Hello,
i am a newbie at ms access, please help
this is a code i created to be able to get the multiple users i have selected in the form. i was able to select the users in the form an select folder however i am unable to save the user name to the table. i am able to save the folder name. what should i do? -
-
Dim vtr As Variant
-
Dim frm As Form, ctl As Control
-
Set frm = Forms!Form_Assign
-
ctl = frm!listFolderUserList
-
ctr = ctl.ItemsSelected.count
-
-
If ctr > 0 Then
-
selList = ctl.ItemsSelected
-
FolderID = Me.FolderName.Value
-
For Each vtr In Me.listFolderUserList.ItemsSelected
-
usrID = Me.listFolderUserList.ItemData(vtr)
-
sqlStr = "Insert into FolderLDAP (FolderID, UserID) " _
-
+ "(" + FolderID + "," + usrID + ")"
-
CurrentDb.Execute sqlStr, dbFailOnError
-
-
Next
-
End If
-
-
please help!
thanks,
lyanne
Assuming [FolderID] and [UserID] are Text, which you seem to indicate, the following code will do the trick: -
Dim vtr As Variant, frm As Form, ctl As Control
-
-
Set frm = Forms!Form_Assign
-
Set ctl = frm!listFolderUserList
-
-
ctr = ctl.ItemsSelected.Count
-
-
If ctr > 0 And Not IsNull(Me![FolderName]) Then
-
FolderID = Me.FolderName.Value
-
For Each vtr In Me.listFolderUserList.ItemsSelected
-
usrID = Me.listFolderUserList.ItemData(vtr)
-
sqlStr = "Insert into FolderLDAP (FolderID, UserID) " + "Values ('" + FolderID + "', '" + usrID + "')"
-
CurrentDb.Execute sqlStr, dbFailOnError
-
Next
-
End If
FolderID is a number - PK and User ID is a text, is that the reason there is an error?
FolderID is a number - PK and User ID is a text, is that the reason there is an error?
More than likely it is.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: newbie_mw |
last post by:
Hi, I need urgent help with a novice problem. I would appreciate any
advice, suggestions... Thanks a lot in advance! Here it is:
I created a sign-up sheet (reg.html) where people fill in their...
|
by: Mike Chirico |
last post by:
Hopefully this will help someone...
Helpful Things to Know about MySQL
Mike Chirico (mchirico@users.sourceforge.net)
Last Updated: Fri Apr 16 11:47:34 EDT 2004
The latest version of this...
|
by: stu_gots |
last post by:
I have been losing sleep over this puzzle, and I'm convinced my train
of thought is heading in the wrong direction. It is difficult to
explain my circumstances, so I will present an identical...
|
by: x muzuo |
last post by:
Hi guys,
I have got a prob of javascript form validation which just doesnt work
with my ASP code. Can any one help me out please.
Here is the code:
{////<<head>
<title>IIBO Submit Page</title>...
|
by: Chris Kettenbach |
last post by:
Hi Peter,
I get error when processing the stylesheet. It errors here.
<xsl:for-each select="registration)=1]">
specifically:
Expression does not return a DOM node.
registration)=1]<--
|
by: Suzanne |
last post by:
Hello experts,
I am a VBA newbie. Most of the tricks I apply to my applications I learn
from here or google. I couldn't find a solution for the following two
things, they both are related to...
|
by: newbie |
last post by:
hello
How can I update more than one tables on the same form? The
relationship is one to many from a master table to 3 other related
tables. on the form, I have to setvalue for a few...
|
by: Jim S. |
last post by:
hi guys and gals,
i have an array, but i have the hardest time putting the value in the table,
so what is the normal procedure?
thanks
Jim
|
by: Jay |
last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send
text messages to many, many employees via system.timer at a 5 second
interval. Basically, I look in a SQL table (queue) to...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |