Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / February 2008

Tip: Looking for answers? Try searching our database.

Before insert and check box and subform

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
a - 16 Feb 2008 20:53 GMT
Thank You
I have subform and form (Master form)
The Master Form Contain Check box name checkbox1
the subform is (data sheet) and allow addition = true
In the subform before insert event I try all the next code but not work
correct I want prevent user from data entery until check box = true or
checked
why all of this code not work???
====================
(1)
If Parent.checkbox1.Value = False  Then
Cancel = True
Else
'
End If
============
(2)
If Parent.checkbox1.Value = 0 Then
Cancel = True
Else
'
End If
===================
(3)
If Me.Parent.checkbox1.Value = 0 Then
Cancel = True
Else
'
End If
========================
Why all this code not work correctly
Jeanette Cunningham - 17 Feb 2008 21:16 GMT
Try setting the subform's Data Entry to Yes (property dialog, data tab)

> Thank You
> I have subform and form (Master form)
[quoted text clipped - 27 lines]
> ========================
> Why all this code not work correctly
Dirk Goldgar - 17 Feb 2008 22:49 GMT
> Thank You
> I have subform and form (Master form)
[quoted text clipped - 27 lines]
> ========================
> Why all this code not work correctly

In principle, all of these should work, and do in a test form I set up.  Is
checkbox1 a bound control, or unbound?  Is it actually False when you test
the code, or is it possible that it is Null (looking rather gray instead of
white)?  What happens if you check it and then un-check it, and then try to
add a record in the subform?

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

a - 18 Feb 2008 18:48 GMT
Thank Mr
Dirk Goldgar
About Your Reply And Help

The Code work when assign defult value to checkbox1 to 0

<dg@NOdataSPAMgnostics.com.invalid> wrote in message
news:3D974EFC-8039-4BC5-9E44-E7052773498B@microsoft.com...
>> Thank You
>> I have subform and form (Master form)
[quoted text clipped - 33 lines]
> instead of white)?  What happens if you check it and then un-check it, and
> then try to add a record in the subform?
Dirk Goldgar - 19 Feb 2008 04:22 GMT
> Thank Mr
> Dirk Goldgar
> About Your Reply And Help

You're welcome.

> The Code work when assign defult value to checkbox1 to 0

That implies that the checkbox was Null before, and that's why the code
wasn't working.  I trust that your fix has corrected the problem.  If not,
write back.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.