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!

Select records to update on continuous form 1

Status
Not open for further replies.

GPM4663

Technical User
Aug 9, 2001
165
GB
Hi,
I have a continuous form and would like to use an unbound check box to select certain records to update. Once selected there will be a button on the footer for "Add Date". Another form will pop up where the date can be entered and on clicking OK the date will be added to all the records on the form that had been selected with the unbound check box. I don't want to do it using listboxes and thought there might be a way using recordsetclone?

Any ideas I'd appreciate it,

Many thanks

GPM
 
Why not bind the checkboxes to the table and use a parameterized prompt in an update query, then run a second query to "uncheck all?"

In the [!]Update to[/!] line of your update query, enter the following:
Code:
[Enter date for selected records]

You may need to surround the square brackets with # symbols to force Access to treat the text as a date, like this:
Code:
[!]#[/!][Enter date for selected records][!]#[/!]

Your selection criteria for the update query will be -1 or True for your checkbox control.

Hope this helps.

Tom


Born once die twice; born twice die once.
 
I have found that the easiest way to implement what you are trying to do is to add a field called "Selected" to your table (I include a field like this to most of my tables). Then you simply include this field in your query (for the recordsource) and put this field on your continuous form.
 
This is code that I use on a continuous form.
As the focus moves from record to record, you can copy, paste, whatever to the active record.

Private sub Whatever
Dim n as integer
'CountEm is function that counts displayed records on a continuous form
For n = 1 To CountEm

'Cycle thru records on a continuous form
DoCmd.GoToRecord acDataForm, "frmRABud", acGoTo, n

'run code for active record

Next n
'on completion return to first record
DoCmd.GoToRecord acDataForm, "frmRABud", acFirst

End If


'count the number of records on the continuous form
Public Function CountEm()
On Error GoTo CountEm

Me.RecordsetClone.MoveLast
CountEm = Me.RecordsetClone.RecordCount

Exit_CountEm:
Exit Function

CountEm:
MsgBox Err.Description
Resume Exit_CountEm

End Function
 
Thanks AccessDB that worked a treat!

GPM
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top