Hm, I hope what I am trying to do is right.. but..What I am doing is using a list of people. And then from the list box form, I select people to append their name under the event's table.
I hope that makes more sense.
Private Sub DeleteRecord_Click()
Dim strSql As String
strSql = "DELETE [EventName] FROM tblEvents WHERE " & _
"tblEvents.[EventName] = '" & Me![EventList] & "'"
CurrentDb.Execute strSql, dbFailOnError
Me![EventList].Requery ' requery the list
End Sub
oh! But i do have something very similar. It deltedes the selected item though. Any idea how to make it append to the second table?
Code:Private Sub DeleteRecord_Click() Dim strSql As String strSql = "DELETE [EventName] FROM tblEvents WHERE " & _ "tblEvents.[EventName] = '" & Me![EventList] & "'" CurrentDb.Execute strSql, dbFailOnError Me![EventList].Requery ' requery the list End Sub
strSQL = "UPDATE tblSecondTable SET [Field1] = '" & Listbox1.value & "' " & _
"WHERE [secondTableID] = tableIDNumber;"
CurrentDb.Execute strSQL, dbFailOnError
' Requery both list boxes Here.
you are awesome! I will work with this later tomorrow (later here), but this seems right. I will let you know when I am done.
Going to add some rep points.
well, i guess i spoke too soon. I can not find a way to make it work. Then doing some more research i found this site.
I have these two tables:
tblNames
tblEvent
and both share the
FullName
field.
How can I make the names move with the buttons according to the list box? And then remove them if they were already selected?
I hope I am not piling on more![]()
wow, you have goo me there. I am not sure what to do after that. I mean i know how to delete a selected file. But no matter what I do I can't get thew append query to work properly. It sounds like you seem to have knowlege about VBA judging by you name however haha.
alright. I had a look at it, but the appending wasnt goign on so i looked a bit further and came across this here.
I will change it around to see if it can suit my needs. I will let you know if I need any more help.
thanks so far!