Change multi records on continous form

musclecarlover07

Registered User.
Local time
Today, 10:38
Joined
May 4, 2012
Messages
236
I have a form (Form4) which has a a list box (list11) that allows multi select. When I select on the records I need I hit a button that opens a form up with the selected records. This form is a continuous form. I have an unbound combo box (Combo55). Its values come from a specific table. I want to hit a button and change the field "Assigned" on all the records showing to the value that I selected in Combo55.

The problem is it only changes the value of the currently selected record. How Do I get it to change the value of all records that are showing?

Im only testing this idea with default field names. Before I implement the database I have to get a working model and present it. So I am building this and naming at the moment isnt important.
 
I usually execute an update query behind the button. It would look somethng like this:
Code:
   Dim strSQL As String
   Dim db As Database
 
   Set db = CurrentDb
 
   strSQL = "UPDATE tblTableName " & _
   "SET [tblTableName].Assigned = " & Me.Combo55.Value & ";"
   db.Execute (strSQL)
I know this isn't a complete solution. You need to add your WHERE conditions. But I hope this gets you moving in the right direction.

_________________
Regards,
Marvin M
Windows 7 Professional, MS Access 2007/2010
Windows 8 Professional, MS Access 2013
-------------------------------------------------------------------------------------------------------------------
If my post has helped you, please click the scales or click the 'Thumbs up'. Thanks!
-------------------------------------------------------------------------------------------------------------------
 
I am lost on what this will actually accomplish. I just need somethign that will check the first record change the data move to the next record (if there is one) change the data on that record and continue.

If what you given me is on the right way to accomplishing that then thank you and I apologize. I'm just not familiar enough with VBA to pick up what alot of things mean/refer to.
 
?? Not sure I'm following the question.

The records that are showing in your form (form's recordsource) reside in a table or query. If you want to change the underlying data, you could use an Update query to change the underlying table; then requery the form.
 
So MarvinM it turns out what you provided works almost perfect. Only problem is it is updating all the records. Now I'm trying to figure out how to only do it only to the records that are currently showing on the form.
 

Users who are viewing this thread

Back
Top Bottom