code to allow edits in form AND subform

Ok, here goes.............
I have a form (frmBOL) which contains a subform (sfrmData).  I have this 
code working to allow the form to be edited, but I can't seem to incorporate 
the subform into it.  Everything I try gives me an error.  Can anyone help?

Private Sub cmdOK_Click()
    Dim sPassword As String

    sPassword = Nz(Me.txtPassword.Value, "")

    
    ' if it is a valid password, we let them edit the
    ' form that called this form. The calling form is
    ' responsible for check that the current user is
    ' either the QA tech on the record, or a member
    ' of the admins or full permissions group, this form
    ' only checks to see if the password they are entering
    ' top unlock that form is valid
    If ufnIsValidUserNamePassword([Forms]![frmSupervisor]![txtUserName], 
sPassword) Then
        Forms!frmBol.AllowEdits = True

        DoCmd.Close acForm, Me.Name
    Else
        MsgBox "Unable to validate password, please verify it is typed 
correctly!", vbExclamation
    End If
End Sub
-- 
Miranda
0
Utf
6/25/2007 6:18:01 PM
access.formscoding 7494 articles. 0 followers. Follow

2 Replies
2203 Views

Similar Articles

[PageSpeed] 28

Under Forms!frmBol.AllowEdits = True add:
Forms!frmBol!NameOfSubformControlOnfrmBOL.Form.AllowEdits = True

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resource@pcdatasheet.com




"Miranda" <Miranda@network.com> wrote in message 
news:44AEAAB8-B267-41EE-92C8-C5008285426B@microsoft.com...
> Ok, here goes.............
> I have a form (frmBOL) which contains a subform (sfrmData).  I have this
> code working to allow the form to be edited, but I can't seem to 
> incorporate
> the subform into it.  Everything I try gives me an error.  Can anyone 
> help?
>
> Private Sub cmdOK_Click()
>    Dim sPassword As String
>
>    sPassword = Nz(Me.txtPassword.Value, "")
>
>
>    ' if it is a valid password, we let them edit the
>    ' form that called this form. The calling form is
>    ' responsible for check that the current user is
>    ' either the QA tech on the record, or a member
>    ' of the admins or full permissions group, this form
>    ' only checks to see if the password they are entering
>    ' top unlock that form is valid
>    If ufnIsValidUserNamePassword([Forms]![frmSupervisor]![txtUserName],
> sPassword) Then
>        Forms!frmBol.AllowEdits = True
>
>        DoCmd.Close acForm, Me.Name
>    Else
>        MsgBox "Unable to validate password, please verify it is typed
> correctly!", vbExclamation
>    End If
> End Sub
> -- 
> Miranda 


0
Steve
6/25/2007 6:33:40 PM
Thank you sooo much!
-- 
Miranda


"Steve" wrote:

> Under Forms!frmBol.AllowEdits = True add:
> Forms!frmBol!NameOfSubformControlOnfrmBOL.Form.AllowEdits = True
> 
> PC Datasheet
> Providing Customers A Resource For Help With Access, Excel And Word
> Applications
> resource@pcdatasheet.com
> 
> 
> 
> 
> "Miranda" <Miranda@network.com> wrote in message 
> news:44AEAAB8-B267-41EE-92C8-C5008285426B@microsoft.com...
> > Ok, here goes.............
> > I have a form (frmBOL) which contains a subform (sfrmData).  I have this
> > code working to allow the form to be edited, but I can't seem to 
> > incorporate
> > the subform into it.  Everything I try gives me an error.  Can anyone 
> > help?
> >
> > Private Sub cmdOK_Click()
> >    Dim sPassword As String
> >
> >    sPassword = Nz(Me.txtPassword.Value, "")
> >
> >
> >    ' if it is a valid password, we let them edit the
> >    ' form that called this form. The calling form is
> >    ' responsible for check that the current user is
> >    ' either the QA tech on the record, or a member
> >    ' of the admins or full permissions group, this form
> >    ' only checks to see if the password they are entering
> >    ' top unlock that form is valid
> >    If ufnIsValidUserNamePassword([Forms]![frmSupervisor]![txtUserName],
> > sPassword) Then
> >        Forms!frmBol.AllowEdits = True
> >
> >        DoCmd.Close acForm, Me.Name
> >    Else
> >        MsgBox "Unable to validate password, please verify it is typed
> > correctly!", vbExclamation
> >    End If
> > End Sub
> > -- 
> > Miranda 
> 
> 
> 
0
Utf
6/25/2007 6:43:01 PM
Reply:

Similar Artilces:

Integrate Paycodes, benefit codes and deduction codes
Has anyone used integration manager to update new pay rates, deduction amounts and benefit amounts for employees? At the beginning of each year, our company gives pay increases and we need to update the pay codes, deduction codes and benefit codes for 40 employees, which we get the information from a spreadsheet. I thought that maybe I could use integration manager to update the pay, benefit and deduction codes instead of going into each employee's card, which is time consuming. Thanks, Laura Integration Manager will allow you to do this. Use the Payroll Master Destination. one ...

How to requery from a form
I have a form that has a text box on which i would like to type some text into then i would like it to do a requery every time i change the text. but it not a requery on the query the form is based on it needs to requery on a different query thnak "Simon" <S.Dickson@shos.co.uk> wrote in message news:1176363215.854267.69050@d57g2000hsg.googlegroups.com... >I have a form that has a text box on which i would like to type some > text into then i would like it to do a requery every time i change the > text. but it not a requery on the > query the form is based on ...

zip codes don't merge #2
I am trying to mail merge w/ Word 2000 the names and addresses in my worksheet. When I get to the part to choose the format for the mailing labels, I choose F1, F2, etc. to F6 (which is the zip code column). A few do get there, but the vast majority stop at the state, leaving off the entire zip code. I have gone to menu/format and selected text in the number tab. I have gone to format/cells and chosen special/zip code in the number tab. I've read Excel for Dummies. Please help me. TIA bb ...

How to Import DVD into Apple iMovie for Further Editing
From: [url=http://www.applemacvideo.com/articles/how-to-put-dvd-into-apple-imovie.html#179]Put DVD into Apple iMovie[/url] One of the benefits about digital video is that the videos can be shared with family and friends. iMovie is created for this purpose, just several steps, you can create your own videos and publish them on web, like YouTube, or enjoy them on iPod, iPhone, and Apple TV. However, the formats which iMovie supported are very limited: 3GP,MOV and MP4. If you want to import DVD to iMovie, you need to convert DVD to iMovie compatible video first. A [url=http://www.applemacvide...

concatenating two vendor codes
My company recently changed the vendor codes and now I end up with two separate sets of data for each vendor. Obviously I could just leave the vendor code field out. I don't want to do that so what I need to do is concatenate the two codes. Example Vendor Code Vendor Name 123 Joe's Supplies ABC Joe's Supplies what I need is this Vendor Code Vendor Name 123/ABC Joe's Supplies any ideas? Rather than create a new record for each vendor, add another field to the table -- call it NewVendorCode -- and put th...

Can MS EXCEL remove duplicates and separate by color coded items ?
Can MS EXCEL remove duplicates and separate by color coded items ? I am NOT technical and have just started using MS EXCEL. Can anyone PLEASE HELP me: 1. How can I automatically remove duplicates using EXCEL ? ie the same info input more than once on different lines. Can EXCEL do this ? 2, I have color coded the text in the certain lines in terms of priority. can Excel rearrange the data by color ? If yes, How do I do it ? I think I have EXCEL '97 Thanks for your help in advance. Hi 1. You can extract the unique items to a new list using menu Data > Filter > Advanced fil...

16 bit code
Hello, I have a 16 bit code to maintain. (It is too complex to copile it to 32 bit) so all we are doing is support. Now they want to add a small feature, where I need to copy long file names in the project. I know we can not do long file name copies in vc++ (1.52). So I wrote a program in VC++(6.0) which does directory copy. My questions are 1. How can I call a 32 bit exe (I guess WinExec should work)? 2. How can I make the 16 bit to wait till the 32 bit code completes? 3. Is there any other better way to do this? (other than converting to 32 bit) Thanks. I actually do this in an old 16-bi...

area codes is auto filling my own 9 digit ph# vs just area code
When I enter a phone number for a contact it autofills with my personal area code and phone number instead of just the area code. How to I change this to just autofil the area code? I am using Outlook 2007 on an ACER laptop. Make sure you have your area code entered correctly in "Dialing Properties". "Computer Dummy" wrote: > When I enter a phone number for a contact it autofills with my personal area > code and phone number instead of just the area code. How to I change this to > just autofil the area code? I am using Outlook 2007 on an ACER ...

VBA Code for Pasting Sheets
I would like a spreadhseet that pastes the contents of one sheet into another sheet. I like like to do this for 7 different sheets For example: I would like paste the contents form sheet titled "sheet1" into a sheet titled "data1". Continue to process for pasting "sheet2" into "data2" and "sheet3" into "data3" all way until "sheet7" and "data7". thanks, Curt Subject: Automated Copy Paste Subject: Copy/Paste Import/Export Data VBA Code On Apr 27, 10:49=A0am, Curt <C...@discussions.mi...

MC/VISA joint code
Isn't there any way to combine the blocks (4* & 5*) for MC/VISA credit cards? It's a pain to have them separate because my bank posts them together. It is the same company afterall. It would save me a lot of time adding separate entries together to reconcile the statement! I do not know of a way to do what you are asking, but I have found that using the # symbol as follows works better than using the * symbol: 4############### 5############### If you use the * symbol it is a wild card with no determined length. The # symbol requires that the characters after the first d...

Open a form using a comand button on another form
By using a command button on a certain form I am oppenig an other form at a cetain record by using some criteria. I am using the command button wizard to do that. When the form oppens however, I want to be able to move to other records of the form record source. Is there an easy way to do that? Thanks in advance Michalis Instead of passing the criteria in the WhereCondition, pass it in OpenArgs instead. Then use the form's Load event to FindFirst in the RecordsetClone, and set the Bookmark. -- Allen Browne - Microsoft MVP. Perth, Western Australia Tips for Access users - http:/...

Typing an adress in a form and verify if it exist in another form
Hi, One form for user without permit. One form for user with permit. If a user without permit takes a permit, a click on a button transfer the user in the form for user with permit and destroy the user without permit. But ! Sometimes a user with permit is created, and we realize to late that the same user already existed in the form for user without permit. I would like, after finishing to type the user address, using the form for user with permit, to verify if the address already exist in the table for user without permit. In both form, the address is compose of three fields : number, apa...

Money 2004 - Experian Offer
I just loaded Money 2004 Deluxe and converted my 2003 files with no problem. I decided to give the free year of credit monitoring from Experian a try but after filling everything out I get an error that the provided code has expired. I neither had nor provided any code for this offer, I only used the link from Money 2004. Now Experian was more than willing to set up a $79 account if I wanted to proceed. Any solution out there? I have the same problem... I am looking for a FREE way to contact Microsoft about this problem. >-----Original Message----- >I just loaded Money 2004 ...

Customize Lead Phone Call Activity form and Add New Activities
Help Please??? I have a new MS-CRM implementation and I have some questions on customizing the activity forms and the types of activities available: 1. How do I customize the Lead Phone Call Activity form to add fields like Company name and City, etc.? Shouldn't this be able to be done with the built-in form editor? Since it seems that phone call activities have an object code of "137" (got this by digging through the Form Editor’s default XML files), I tried manually going directly to: http://crm/tools/formEditor/formEditor.aspx?objectTypeCode=137 but the form that app...

Analytical Accounting
Hi, One of my Client's is considering to go down AA path with approx 300,000 AA dimension codes. I would like to hear whether such data set is manageable from Query wizard etc. appreciate your thoughts. Good Morning PR, I found that the issue isn't the number of AA Trx Dim Codes it is the size of the AAG30000 and AAG40000 tables the more entries the longer it takes to product the report. I had one client that started having a cached SSRS report with AA information as a management level report and a different SSRS report with a more restrictive dataset for reporting ...

Change code with code?
Hi All..... I've got 31 Excel .xlsm files to modify the "Change Event" macro in. Is it possible to open and perform this with code, or must I do each one by hand? TIA Vaya con Dios, Chuck, CABGx3 If it is the same change in each sheet, it would probably be just as easy to go into the VBE, double click on the first sheet, make the correction, then copy that correction and double click the second sheet, delete and paste. Repeat the process 30 times. Takes less time than writing the code to do it. "CLR" <CLR@discussions.microsoft.com> wr...

2003 Contact Form Mystery
A while ago I designed a contact form to include a new merged note field. It worked fine, except that now whenever I add a new contact the fields are filled in with another contacts information. So I have to delete each entry before putting in a new one. To make matters worse, I can't select a new blank form or get back the original default form. I tried erasing the frmcache.dat but it keeps coming back --- still filled in. Anybody? ...

Access 2003
I have a form that goes to a subform for searching. It works perfectly on my computer; however, when another user opens it and attempts to perform a search, they receive the Error Code 2455 message. When I debug, it gets stuck on "Me.book_subform.Form.Filter = strWhereSearch" and says that book_subform cannot be found. It isn't a rights issue, it isn't a mapping issue. What am I missing? check your naming. This is an issue that often confused. In this syntax: Me.book_subform.Form.Filter > = strWhereSearch book_subform is the name of the subform control on the main ...

Write a code by code
How can I write a code from procedure to some Workbook's ThisWorkbook? With procedure1 a make Workbook with a table. I need to write Auto_Close procedure to ThisWorkbook which makes some controls before I close it. Is it possible? <jenista.j@discussions.microsoft.com> wrote in message news:0be501c52fab$ba0b6830$a601280a@phx.gbl... > How can I write a code from procedure to some Workbook's > ThisWorkbook? With procedure1 a make Workbook with a table. > I need to write Auto_Close procedure to ThisWorkbook which > makes some controls before I close it. Is it possible? ...

Coding Duplicate Records
How can I code that a record is to be "K" kept or "D" deleted when compared to its next row? Example: A sorted file by Address BEFORE LastName Address Sales Date Keep/Delete 1. WASSEM 0N642 TITUS PL 67,500 6/25/2001 2. HART 0N655 E WEAVER CIR 70,000 3/19/2001 3. HART 0N655 E WEAVER CIR 40,000 3/19/2001 4. HART 0N655 WEAVER CIRCLE 33,700 6/19/1998 5. POYTH 0N662 W WEAVER CIR 294,690 6/21/2000 6. BLAND 0N670 GREEN PL ...

help with/for pivottable code
Hi everyone! I have code that takes a large workbook and divides it into a number of separate new workbooks based on data that is in column A. What i need is to create code that will create a pivot table in the new workbook. here is my code: Sub Regionalize() Dim wks As Worksheet Dim wksNew As Worksheet Dim wbk As Workbook Dim rng As Range Dim cell As Range Dim lRow As Long Dim sFileName As String Dim sFolder As String Dim sRegion As String Set wks = Sheets("region") Set rng = wks.Range("regiondata") ...

Rebar example code
Can anyone send me a rebar code example. There does not seem to be any examples other than Microsoft documentation. Theres nothing on CodeProject or else where. Many thanks in advance, Aaron On 8 Apr 2007 13:30:14 -0700, "AaronNGray" <aaronngray@gmail.com> wrote: >Can anyone send me a rebar code example. There does not seem to be any >examples other than Microsoft documentation. Theres nothing on >CodeProject or else where. > >Many thanks in advance, > >Aaron CodeProject has that... https://secure.codeproject.com/docking/#ReBars : http://www.codepro...

Replicating Code!!!
Hi there folks, I am currently creating a student achievement spreadsheet and I a using ticks in each cell to state if the student has passed the unit o not. I am using a simple VBA code to have any cell, within a specifie range, ticked upon selecting it. If the cell within the specifie range, already has a tick, the code will remove it. The trick to th code is the use of the letter "a" in a cell that has had it's fon formatted to marlett!! My code: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Cells.Count > 1 Then Exit Sub If Not Intersect(Target,...

not to edit nor change the text
hii i have a form that consist of a text control which i have changed to combo box and i want to select name out of that to perform a particular action that work perfectly no problem. but the prolem is that i want it to be readonly or can't change or edit the items inside . thankx Naveed, >... i want it to be readonly or can't change or edit the items inside . Well, "read only" would really mean that the combo is disabled and locked from any selection at all. Set the combo's Limit To List property to Yes. Now, the combo will only allow ...

Does CRM allow products to be grouped by categories?
Im still in the process of trying to implement our new crm app and even though i've looked through the product table I cannot seem to find any fields that would allow me to group my products into categories. If its called by a different name can someone please tell me what it is. Secondly if its not there can someone send me to a good tutorial as to how I can add and also have those changes reflected in the form (interface). Thanks CRM does not support grouping products. It does has a concept of kits which allows you to in effect create a new product or kit out of other products. ...