Update multiple records at once, from a form (1 Viewer)

Lyconal

Registered User.
Local time
Today, 12:12
Joined
May 18, 2009
Messages
35
Hi,

I need to create a form that can do the following:

1) Show multiple records per form (Like datasheet view maybe?)
2) I require to have a checkbox work 'independantly' of each record, without being a field within that table

The reason for this, is that I want the following to happen:

Open Form and records based on Query are dispalyed.

Enter tracking details into 2 unbound text boxes, and then tick each record that is included with this shipment. Then on cmdclick, SQL update the records selected with the tracking information.

Anybody any suggestions on the best way of acheiving this?

Cheers
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:12
Joined
Aug 30, 2003
Messages
36,125
You will not be able to do that with an unbound checkbox (on a continuous or datasheet form). If you try it, you'll find that checking any record checks them all. From the sound of it, I'd probably use a multiselect listbox instead.
 

Lyconal

Registered User.
Local time
Today, 12:12
Joined
May 18, 2009
Messages
35
The multi-select list box works a treat :)

Many thanks,

P.S - Does anybody know how to select all records from a continous form for an UPDATE query?

Cheers
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 12:12
Joined
Aug 30, 2003
Messages
36,125
Presuming the form was filtered in some way, apply the same criteria to an UPDATE query. If that's not practical, you can open a recordset on the form's source and update them one by one.
 

Lyconal

Registered User.
Local time
Today, 12:12
Joined
May 18, 2009
Messages
35
I have tried to same criteria, but it doesnt seem to want to work (Only for the 'selected' record)

I basically want to update any of the records within the recordset, where the field "Sent" has the value "Yes", with the Tracking info from the unbound boxes above.
Like I say, it works for the selected record, but would like it to be automated for all records currently shown in the continuous form (With source of a query)

Cheers
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 20:12
Joined
Sep 12, 2006
Messages
15,655
Like I say, it works for the selected record, but would like it to be automated for all records currently shown in the continuous form (With source of a query)

currently shown - do you mean actually visible, rather than all records included in the forms recordset? if so, then pretty hard to do, i would have thought - maybe not possible
 

Lyconal

Registered User.
Local time
Today, 12:12
Joined
May 18, 2009
Messages
35
Well its a continuous form based on a query, so shows all records on the form.
 

kbsudhir

Sudhir
Local time
Tomorrow, 00:42
Joined
Dec 27, 2007
Messages
20
Hi Lyconal,

is it possible for you provide the code for the above. I am also trying to to the same.

I am able to get the records in a subform now I want only the selected records should be updated. The field to be update remains same i.e Static.

Please guide.

Regards
Sudhir
 
Last edited:

Users who are viewing this thread

Top Bottom