Locking Form and Subform-What am I doing wrong?

Okay, I have a form that includes a checkbox "Closed_Check", when this box is 
checked I need to lock that specific record in the form and subform.  
Currently I've tried:

 If Closed_Check = True Then
           Me.AllowEdits = False
           Me.AllowDeletions = False
       Else
           Me.AllowEdits = True
           Me.AllowDeletions = True
       End If

and placed this in the On Current event field for both the form and subform. 
It works, problem is it locks the following records that are not closed.

What am I missing?
HELP
-- 
Lori A. Pong
0
Utf
11/2/2007 7:51:01 PM
access.formscoding 7493 articles. 0 followers. Follow

3 Replies
589 Views

Similar Articles

[PageSpeed] 2

With continuous forms, it's an all-or-nothing proposition.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Lori" <lpong@sternconstruction.com> wrote in message 
news:E6B1A886-2619-4935-9A36-6B6AA43BA2A9@microsoft.com...
> Okay, I have a form that includes a checkbox "Closed_Check", when this box 
> is
> checked I need to lock that specific record in the form and subform.
> Currently I've tried:
>
> If Closed_Check = True Then
>           Me.AllowEdits = False
>           Me.AllowDeletions = False
>       Else
>           Me.AllowEdits = True
>           Me.AllowDeletions = True
>       End If
>
> and placed this in the On Current event field for both the form and 
> subform.
> It works, problem is it locks the following records that are not closed.
>
> What am I missing?
> HELP
> -- 
> Lori A. Pong 


0
Douglas
11/2/2007 7:58:24 PM
then what is a person to do?
I have the check box there for when an item is closed (naturally to stop 
someone from editing by mistake)
The form is a single form view and the subform is a datasheet.  They are 
linked by a JEID#.
-- 
Lori A. Pong


"Douglas J. Steele" wrote:

> With continuous forms, it's an all-or-nothing proposition.
> 
> -- 
> Doug Steele, Microsoft Access MVP
> http://I.Am/DougSteele
> (no e-mails, please!)
> 
> 
> "Lori" <lpong@sternconstruction.com> wrote in message 
> news:E6B1A886-2619-4935-9A36-6B6AA43BA2A9@microsoft.com...
> > Okay, I have a form that includes a checkbox "Closed_Check", when this box 
> > is
> > checked I need to lock that specific record in the form and subform.
> > Currently I've tried:
> >
> > If Closed_Check = True Then
> >           Me.AllowEdits = False
> >           Me.AllowDeletions = False
> >       Else
> >           Me.AllowEdits = True
> >           Me.AllowDeletions = True
> >       End If
> >
> > and placed this in the On Current event field for both the form and 
> > subform.
> > It works, problem is it locks the following records that are not closed.
> >
> > What am I missing?
> > HELP
> > -- 
> > Lori A. Pong 
> 
> 
> 
0
Utf
11/2/2007 8:06:01 PM
Put that code in the form's Current event.

Yes, that will either lock every row or unlock every row. However, you can't 
change a row unless it's the active row, and putting the code in the Current 
event insures that whether or not the form is locked depends on the current 
row.

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Lori" <lpong@sternconstruction.com> wrote in message 
news:7A23E4FE-5CA5-4EE0-BB3A-B1F9ACB3356E@microsoft.com...
> then what is a person to do?
> I have the check box there for when an item is closed (naturally to stop
> someone from editing by mistake)
> The form is a single form view and the subform is a datasheet.  They are
> linked by a JEID#.
> -- 
> Lori A. Pong
>
>
> "Douglas J. Steele" wrote:
>
>> With continuous forms, it's an all-or-nothing proposition.
>>
>> -- 
>> Doug Steele, Microsoft Access MVP
>> http://I.Am/DougSteele
>> (no e-mails, please!)
>>
>>
>> "Lori" <lpong@sternconstruction.com> wrote in message
>> news:E6B1A886-2619-4935-9A36-6B6AA43BA2A9@microsoft.com...
>> > Okay, I have a form that includes a checkbox "Closed_Check", when this 
>> > box
>> > is
>> > checked I need to lock that specific record in the form and subform.
>> > Currently I've tried:
>> >
>> > If Closed_Check = True Then
>> >           Me.AllowEdits = False
>> >           Me.AllowDeletions = False
>> >       Else
>> >           Me.AllowEdits = True
>> >           Me.AllowDeletions = True
>> >       End If
>> >
>> > and placed this in the On Current event field for both the form and
>> > subform.
>> > It works, problem is it locks the following records that are not 
>> > closed.
>> >
>> > What am I missing?
>> > HELP
>> > -- 
>> > Lori A. Pong
>>
>>
>> 


0
Douglas
11/2/2007 9:00:00 PM
Reply:

Similar Artilces:

locking up
This might be more of a GDI question, but since I'm in MFC, I'll ask: Would BitBlt-ing to the screen repeatedly tend to lock up a program, after alt+tabbing to another application? If so, why? This seems to be happening to me, and I want to get to the bottom of the problem. What I have is either a fade loop or a screen-size redraw, both based on a timer and bitblt. Quite often, after I leave the program to go to another app, I cannot return and must "end task". "Steve Russell" <srussell@removethisinnernet.net> wrote in message news:%23YFL5Ks%23F...

Is there a way to convert a EXCEL form into a WORD form?
Users: I have an existing form created by someone else, I would like to convert it to a WORD document form and make some changes. I need the individual cells to be meraged and the text box flyout to me drop-downs. Is it possible to do this without having to re-create the form in WORD. Thanks Why don't you do what you want to do in the existing Excel form? Excel is far better and easier to use to design forms. Merging the cells in Excel is done with the click of the mouse. I don't understand the "text box flyout to me drop-downs", but Excel does have drop downs, ...

Block Form
Hello I have a form with a button to send him by e-mail to another person. When I press that Button it opens a Report and send this report by mail. Now my question is: Its possible lock that form after press e-mailButton and its successfully send by mail?Could that e-mailButton be used again when I press New Form? ...

Lock formula to cell
I want a formula to lock to a cell so that when I add or delete a column the formula will always remain with say column H I know if the sheet is Password protected this will prevent this happening but that is no use when I have to unprotect the sheet to delete a column. Anyone got thoughts on this? regards Pat Hi Pat without using VBA you can't achieve this Frank Pat wrote: > I want a formula to lock to a cell so that when I add or delete a > column the formula will always remain with say column H > > I know if the sheet is Password protected this will prevent this >...

name change of a form
Hi, I accidently named a form tblFormName instead of frmFormName. I want to change the name from tbl to frm to use the correct naming convention, so there isn't any confusion if the form is opened from the database window. I checked object dependencies and there are no objects that depend on the form, but there are objects on which the form depends. If I rename the form, will it cause any problems with other objects? (In laymen's terms: will it screw anything up if I change the form name?) Thanks. Can't possibly say. It depends on a lot of things. The Autocorrect feature ...

Desktop Alert Locks Computer
Greetings, I am seeing a little quirk on some of my desktops. It only happens occasionally, but it happens to different models of PC. Not all the time, but once in awhile, I have users that complain of their PC freezing. The only remedy is to do a hard reboot. I have noticed in these instances, that the desktop mail alert ( the preview that pops up by the system clock when you get a new mail) is showing when it froze. If I go into Outlook and turn off the desktop alert, then the PC freezing stops. So, I know that the Desktop Alert is the cause of the problem. Has anyone else ever seen this? Th...

Report/Form need help
I am trying to open report and a form to enter parameters . This is what I have - I keep getting error message. Can someone please tell me what I am doing wrong? Thank you. 'Use this if the source is on the main form Private Sub Report_Open(Cancel As Integer) Me.RecordSource = Forms![PCollector].Form.RecordSource With Forms![PCollector].Form If .OrderByOn Then Me.OrderBy = .OrderBy Me.OrderByOn = True End If If .FilterOn Then Me.Filter = .Filter Me.FilterOn = True End If End With End Sub W...

Form Sizing 08-06-07
-- Thanks David G Albury, Australia DoCmd.Maximize ...

Creating a form from two tables
Im looking for assistance. This database is used for evaluations. so a manager completes a form that has 25 questions. They do 4 evaluations a month on each employee. I have 3 tables the Evaluation information (Table 1), The Answer Information (Table 2) and the Question Table (Table 3) Is there a way to popuplate at form that has all the Evaluation Information, lists each question from table 3 with the Answer Information for each of those questions from Table 2. I haven't begun creating this database yet so if there is a better way to do it i am open to suggestions. Tabl...

Adress book coming up in wrong order
I have Outlook 2007, and windows Xp Profesional When creating a new Email, when I click on the Adress Book, To search through my Contacts, it sorts them according to first names, not last, which is causing me problems to find names, any ways to change this "KBD" <kbd@thejnet.com> wrote in message news:1ab41477-4c04-4546-88ed-905da97b1d5d@v15g2000yqn.googlegroups.com... >I have Outlook 2007, and windows Xp Profesional > > When creating a new Email, when I click on the Adress Book, To search > through my Contacts, it sorts them according to first names, not > l...

locked excel File ??
Hi . I am working with my colleges with one Excel file in a shared file system. Sometime - when I open the file, there is the message "locked from College" - but he is definetly out of office and shut down his PC. We are using Excel 2003 + Excel 2007. What can I do?? THnks for help Susan ...

Locked out of database
Not sure what happened but get a message saying "database has been converted from a prior version of Access by using DAO compactdatabase and is now in a partially converted state." It says I should be able to import tables into a new data base but when I try this it just gives the same message about converting and the data base just doesn't open. Please help because lots at stake, have to do a report based on these tables so am waiting with anticipation!!!x Hi Pete, Usually this means you are opening an earlier version of Access in a new version. Make a copy of the data...

Outllook2007 to open my Outlook2002 Win7 says files locked.
I'm following 2002 to 2007 instructions step by step. When I point Outlook to my ..pst file, I get access restriction messages. How do I make sure these files can be accessed by Outlook 2007? Thanks. Which exact steps are these? From your Outlook 2002 machine, copy the pst-file to your Outlook 2007 machine and place it in a convenient location such as My Documents\Outlook\ In Outlook 2007 you can then reconnect to the pst-file via; File-> Open-> Outlook Data File... For details see; http://www.howto-outlook.com/howto/backupandrestore.htm -- Robert Sparnaai...

OWA 2003 Forms Based Auth Not loading, HTTP 500 Error
I had a exchange 2003 on win 2000 Server working fine, I just moved over the mailboxes to a windows 2003. Now I can't seem to get Forms to come up at all. I install a certificate created by the windows 2000 Server. I get all the other screen but once it get's past the, accept certificate screen, I get an internal error, Http 500 Regular login works fine without the certifcate and I believe with as well. Any help on this? ...

form logic
I'll try to explain the best I can. I have an customer orders form, w/ the order lines being the subform. When a csr is going to enter in a new order, I would like for an pop up form to open up as they enter in a part number if it's specific criteria. For example, if any part number has a stop or a warning on it I want my pop up form to come up. So what I did was on my ItemID field, afterupdate, I put logic there as follows: If me!CustOrderStop = 1 or 2 then DoCmd.OpenForm "frmCustOrderStopMsg" Endif I need for the id to be carried to that form. How do I do that? I'...

excel locks up after selecting a cell #2
excel locks up after selecting a cell. When ever, I select a Cell, that will automatically selects all the cell and this freezes the entire computer. Can any body who would help me resolve this issue? Please help.... ...

Autonumber in a form
I have a form that allows data entry and additions only. What I would like to do is have the record number pop up in a field on the form. Im not sure how to write the code for the event procedure to be able to do this. What would be convienient is that the number would pop up as soon as the form is opened. any suggestions? Tyler Perhaps you and I have a different understanding of "Autonumber"... The Access Autonumber is a system-generated unique key value, whose only (OK, whose primary) use is as a unique row identifier. Since you have no control over the value Access come...

Money "lock-out" solution-thanks Kurt
Kurt Thanks for the idea. It worked. I unistalled money 2002 and the reinstalled using custom mode...up and running again! Thank -you What happens to all your data when you do that? Do you still have your data? I tried reinstalling, but no luck. I hate to uninstall, since I would lose all the data, right? Would appreciate info. Thanks, Alice >-----Original Message----- >Kurt > >Thanks for the idea. It worked. I unistalled money 2002 >and the reinstalled using custom mode...up and running >again! Thank -you >. > Your data is in a file *.mny. This is ind...

Linking Outlook fields from the "Contact Folder" to a custom form in Outlook...
Using Exchange Server 2003/Outlook 2003, we have created a custom Help Desk form in Outlook. We would like the ability to link specific fields from the Contacts Folder, in a drop-down list box if possible. We are far from knowing that something like this is even possible. Would appreciate *any* suggestions. Thank you. Try outlookcode.com or the program_forms or program_vba newsgroup. "Jeff" <wolfcg@gmail.com> wrote in message news:1166997847.011514.163470@48g2000cwx.googlegroups.com... > Using Exchange Server 2003/Outlook 2003, we have created a custom Help > Desk...

Lock autoshape to fixed position
Hello, Does anybody know if it is possible to keep an autoshape to a fixed position. I have a worksheet that has two panes, one is frozen i.e. a fixed header and scrollable rows. On the bottom of the page I want to put a button bar made of shape buttons. The problem is that when I scroll, the buttons scroll too! It would be nices if I can keep them in position. I know that is is possible to add a second window, but that does not look so well... Any ideas? Multiple fixed panes would be a great option! Change the alignment option to be absolute. Picture properties > Layout tab > Advan...

Some forms and swithboards in design view show up blank in form vi
I'm a financial analyst, expert excel user, and began using Access 3 months ago to solve a specific problem. Following along with Jeff Conrad's book, I wrestled with the concepts until I had a fairly servicable application designed to replace a couple of hundred spreadsheets and versions thereof. I also built considerable strength hauling the book to and from the office, in its own briefcase, everyday. The result is better than I expected and especially efficient in consolidating calculations that, until now, could only be done across a tedious network of linked worksheet...

Bind a Form to a Recordset
I am trying to bind a form to a record set using access 2003. However, I can not edit the data in the form. I made sure that the record locks are set correctly. Does anyone know how to bind a recordset to a form and allow the records to be edited (i.e. not read only)? I used the following code: Note: the "frm" and "rst" ojects are defined as public variables in a module. Private Sub btn_Click() Set frm = New Form_TestForm Set rst = New ADODB.Recordset rst.Open "testTable", CurrentProject.Connection, adOpenKeyset, adLockOptimistic Set frm.Recordse...

Form locking up
I've completed my own Linked Table Manager wizard, so that the connections I create to SQL Server and Oracle database on my network don't require a DSN (DSN-less connections). This wizard exists in its own mda file, which I have added as a reference in several of my databases. In my test database, this wizard runs great. I've got a command button that calls a function (fnRefreshLinks) that exists in the wizard. It opens a form, refreshes a list of the linked tables, tests the link, and provides me with some options. When I run this same function from another database, it...

Where am I being locked out?!
This is an unusual problem and I'm hoping someone will have come across something similar before. Before I start I should state that I've hardly used Windows Server or Active Directory, so go easy on me if this is something obvious! I am having my account locked out on a daily basis. I know that this isn't to do with my machine as it happens even if I get my account unlocked and wait a day without turning my machine on I still can't log on the day after. I'm pretty sure it's a piece of software that I've installed somewhere that keeps trying to con...

Display confirmation window when leaving data entry form in BP
When a user is entering time and expense data in Business Portal 3.0 and they either navigate from the window or click Delete without saving, Business Portal displays a window asking the user to confirm their action. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. htt...