Code for Checkbox Validation 
Author Message
 Code for Checkbox Validation

I have a field in a table that contains checkboxes in sequential records.  I
need a code/macro that will allow me to have a message pop-up if the user
tries to check the box in the next record IF the current box is not checked.



Sun, 05 Jan 2003 03:00:00 GMT  
 Code for Checkbox Validation
What are you using to populate your form?



Quote:

> I have a field in a table that contains checkboxes in sequential
records.  I
> need a code/macro that will allow me to have a message pop-up if the
user
> tries to check the box in the next record IF the current box is not
checked.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 05 Jan 2003 03:00:00 GMT  
 Code for Checkbox Validation
Currently the table is populated manually and the checkbox is a control.

Quote:
> What are you using to populate your form?



> > I have a field in a table that contains checkboxes in sequential
> records.  I
> > need a code/macro that will allow me to have a message pop-up if the
> user
> > tries to check the box in the next record IF the current box is not
> checked.

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Sun, 05 Jan 2003 03:00:00 GMT  
 Code for Checkbox Validation

Rebecca,
You can not do this in the table as there are no events to fire your code,
in tables.
I assume you will only have one form open at a time...
So I guess you want to check if the previous records check box is set, as
the user can only set the "current" record.
You could use the RecordsetClone for this.
Have a look in Help.
Use the Bookmark to go to the current record in the clone, then use Move to
go back one, and check the value.
--
Hope This Helps,
Jeff Davies


Quote:
> I have a field in a table that contains checkboxes in sequential records.
I
> need a code/macro that will allow me to have a message pop-up if the user
> tries to check the box in the next record IF the current box is not
checked.



Mon, 06 Jan 2003 03:00:00 GMT  
 Code for Checkbox Validation

I set-up this procedure, which didn't run.  Any ideas what's wrong?

 Dim CheckTask As DAO.Recordset
    Set CheckTask = Me.RecordsetClone
    For Each Record In CheckTask
    If CheckTask.Field(2) = 0 Then
        MsgBox "Task must be completed before proceeding!"
    Me.Bookmark = CheckTask.Bookmark
    End If
    Next

Quote:
> Rebecca,
> You can not do this in the table as there are no events to fire your code,
> in tables.
> I assume you will only have one form open at a time...
> So I guess you want to check if the previous records check box is set, as
> the user can only set the "current" record.
> You could use the RecordsetClone for this.
> Have a look in Help.
> Use the Bookmark to go to the current record in the clone, then use Move
to
> go back one, and check the value.
> --
> Hope This Helps,
> Jeff Davies



> > I have a field in a table that contains checkboxes in sequential
records.
> I
> > need a code/macro that will allow me to have a message pop-up if the
user
> > tries to check the box in the next record IF the current box is not
> checked.



Mon, 06 Jan 2003 03:00:00 GMT  
 Code for Checkbox Validation

There is no "For Each" with a recordset.
With CheckTask
    .MoveFirst
    Do until .EOF
        If...
        End If
        .MoveNext
    Loop


Quote:
> I set-up this procedure, which didn't run.  Any ideas what's wrong?

>  Dim CheckTask As DAO.Recordset
>     Set CheckTask = Me.RecordsetClone
>     For Each Record In CheckTask
>     If CheckTask.Field(2) = 0 Then
>         MsgBox "Task must be completed before proceeding!"
>     Me.Bookmark = CheckTask.Bookmark
>     End If
>     Next


> > Rebecca,
> > You can not do this in the table as there are no events to fire your
code,
> > in tables.
> > I assume you will only have one form open at a time...
> > So I guess you want to check if the previous records check box is set,
as
> > the user can only set the "current" record.
> > You could use the RecordsetClone for this.
> > Have a look in Help.
> > Use the Bookmark to go to the current record in the clone, then use Move
> to
> > go back one, and check the value.
> > --
> > Hope This Helps,
> > Jeff Davies



> > > I have a field in a table that contains checkboxes in sequential
> records.
> > I
> > > need a code/macro that will allow me to have a message pop-up if the
> user
> > > tries to check the box in the next record IF the current box is not
> > checked.



Mon, 06 Jan 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. checkbox validation with vbscript (ol97)

2. Checkbox Validation

3. checkbox validation?

4. VBA code for validation rule

5. Having Trouble w/Data Validation Code (Acc97)

6. Post Code Validation

7. Field validation sample code

8. Small DB validation program code

9. I'm using this code for validation

10. Code driven validation and data manipulation against DBMS

11. Code validation tools

12. I need Path & Filename validation code

 

 
Powered by phpBB® Forum Software