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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Fill Question

Status
Not open for further replies.

Ammodog

Technical User
Dec 13, 2002
97
US
I have a Table TblMsgBank With that I have a Form with a list box of Login Id's and a text box for messages. I have code so that I can multi select individuls in the List box, My question is how can I select those multiple individuals and just type one message, and have the message prefile all of the records. Thanks You.

Here is the Code:

Private Sub Command4_Click()

Dim rst As DAO.Recordset
Dim LogIDs As Variant
Set rst = CurrentDb.OpenRecordset("tblMsgBank")

For Each LogIDs In Me.List2.ItemsSelected
rst.AddNew
rst!LoginID = Me.List2.ItemData(LogIDs)
rst.Update
Next LogIDs

Set rst = Nothing
End Sub

Christopher Abney
"There is no limit to the good you can do if you dont care who gets the credit"
[Afro]
 
It looks like all you are missing is the
rst!Message = Me.txtMessage

Do this before the update and that should put the message from the txtMessage control with every selected LogID.
 
Thanks Sometimes we all lose our minds sometimes LOL!

Christopher Abney
"There is no limit to the good you can do if you dont care who gets the credit"
[Afro]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top