Data Entry = No

Hello,
Below is vba on the On Click of a command button that is used to open a form 
called "frm_AltaDeRegistrosPagina1-2Analista", match the Record ID to the 
local form's Record ID, then make the "Data Entry" attribute = No. For some 
reason it is not working correctly. I need the vba to change the "Data Entry" 
attribute = No, so that I can modify the data on that form. The said form 
above is usually used to add records using the "Data Entry" attribute and via 
using the switchboard "Add Record" setting. Now I  need to access the same 
form to modify records. Can you help me fix the below vba and could you also 
type up vba for me to put on the "On Close" of the form so that the vba sets 
the "Data Entry" setting back = Yes?

Private Sub ModificarRegistrante_Click()

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
    DoCmd.OpenForm stDocName, , , stLinkCriteria
    stLinkCriteria = "[RecordID]=" & Me![RecordID]
    Forms(stDocName).DataEntry = False  

End Sub


Your help is greatly appreciated.

Thanks.
Iram/mcp
0
Utf
6/6/2010 2:27:54 AM
access.formscoding 7493 articles. 0 followers. Follow

6 Replies
1966 Views

Similar Articles

[PageSpeed] 37

On Sat, 5 Jun 2010 19:27:54 -0700, Iram <Iram@discussions.microsoft.com>
wrote:

>Below is vba on the On Click of a command button that is used to open a form 
>called "frm_AltaDeRegistrosPagina1-2Analista", match the Record ID to the 
>local form's Record ID, then make the "Data Entry" attribute = No. For some 
>reason it is not working correctly. I need the vba to change the "Data Entry" 
>attribute = No, so that I can modify the data on that form. The said form 
>above is usually used to add records using the "Data Entry" attribute and via 
>using the switchboard "Add Record" setting. Now I  need to access the same 
>form to modify records. Can you help me fix the below vba and could you also 
>type up vba for me to put on the "On Close" of the form so that the vba sets 
>the "Data Entry" setting back = Yes?

If the form is used (at least occasionally) both to enter new records and to
edit existing ones, you might want to consider saving it with the DataEntry
property set to NO; and instead simply have it navigate to  the new record
when it's opened. This gives you the best of both; a user opening the form
will see a blank new record ready for entry, but will still have the option to
navigate to an older record. The switchboard needn't be involved at all.
-- 

             John W. Vinson [MVP]
0
John
6/6/2010 2:40:37 AM
There is one caveat. When the data entry folks add records I don't want them 
to scroll through the records for any reason. However I will have a 
continuous form showing all records and with command buttons in the next to 
each record so that I can pull up the data entry form in modify mode.

Are you still willing to help me with my endeavor?


Thanks.
Iram


"John W. Vinson" wrote:

> On Sat, 5 Jun 2010 19:27:54 -0700, Iram <Iram@discussions.microsoft.com>
> wrote:
> 
> >Below is vba on the On Click of a command button that is used to open a form 
> >called "frm_AltaDeRegistrosPagina1-2Analista", match the Record ID to the 
> >local form's Record ID, then make the "Data Entry" attribute = No. For some 
> >reason it is not working correctly. I need the vba to change the "Data Entry" 
> >attribute = No, so that I can modify the data on that form. The said form 
> >above is usually used to add records using the "Data Entry" attribute and via 
> >using the switchboard "Add Record" setting. Now I  need to access the same 
> >form to modify records. Can you help me fix the below vba and could you also 
> >type up vba for me to put on the "On Close" of the form so that the vba sets 
> >the "Data Entry" setting back = Yes?
> 
> If the form is used (at least occasionally) both to enter new records and to
> edit existing ones, you might want to consider saving it with the DataEntry
> property set to NO; and instead simply have it navigate to  the new record
> when it's opened. This gives you the best of both; a user opening the form
> will see a blank new record ready for entry, but will still have the option to
> navigate to an older record. The switchboard needn't be involved at all.
> -- 
> 
>              John W. Vinson [MVP]
> .
> 
0
Utf
6/6/2010 4:40:59 AM
=?Utf-8?B?SXJhbQ==?= <Iram@discussions.microsoft.com> wrote in
news:D921383A-C22B-4A45-AD9E-F2B110CF5821@microsoft.com: 

> Hello,
> Below is vba on the On Click of a command button that is used to
> open a form called "frm_AltaDeRegistrosPagina1-2Analista", match
> the Record ID to the local form's Record ID, then make the "Data
> Entry" attribute = No. For some reason it is not working
> correctly. I need the vba to change the "Data Entry" attribute =
> No, so that I can modify the data on that form. The said form 
> above is usually used to add records using the "Data Entry"
> attribute and via using the switchboard "Add Record" setting. Now
> I  need to access the same form to modify records. Can you help me
> fix the below vba and could you also type up vba for me to put on
> the "On Close" of the form so that the vba sets the "Data Entry"
> setting back = Yes? 
> 
> Private Sub ModificarRegistrante_Click()
> 
>     Dim stDocName As String
>     Dim stLinkCriteria As String
> 
>     stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
>     DoCmd.OpenForm stDocName, , , stLinkCriteria
>     stLinkCriteria = "[RecordID]=" & Me![RecordID]
>     Forms(stDocName).DataEntry = False  
> 
> End Sub
> 
> 
> Your help is greatly appreciated.
> 
> Thanks.
> Iram/mcp

Go to Access help and look up the options available for the openform 
method of the docmd object.

In your example above, stLinkCriteria must be before the Docmd 
statement

One of the parameters which you have left blank determines whether 
the form opens ,
docmd.OpenForm stDocName, acNormal,, stLinkCriteria ,acFormEdit, _ 
acWindowNormal




0
Bob
6/6/2010 12:20:52 PM
Iram wrote:

> Hello,
> Below is vba on the On Click of a command button that is used to open a
> form called "frm_AltaDeRegistrosPagina1-2Analista", match the Record ID to
> the local form's Record ID, then make the "Data Entry" attribute = No. For
> some reason it is not working correctly. I need the vba to change the
> "Data Entry" attribute = No, so that I can modify the data on that form.
> The said form above is usually used to add records using the "Data Entry"
> attribute and via
> using the switchboard "Add Record" setting. Now I  need to access the same
> form to modify records. Can you help me fix the below vba and could you
> also type up vba for me to put on the "On Close" of the form so that the
> vba sets the "Data Entry" setting back = Yes?
> 
> Private Sub ModificarRegistrante_Click()
> 
>     Dim stDocName As String
>     Dim stLinkCriteria As String
> 
>     stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
>     DoCmd.OpenForm stDocName, , , stLinkCriteria
>     stLinkCriteria = "[RecordID]=" & Me![RecordID]
>     Forms(stDocName).DataEntry = False
> 
> End Sub

You need to set the value of stLnkCriteria *before* you use it.  And with a 
WHERE clause you don't need to mess with the DataEntry property at all.

 Private Sub ModificarRegistrante_Click()
 
     Dim stDocName As String
     Dim stLinkCriteria As String
 
     stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
     stLinkCriteria = "[RecordID]=" & Me![RecordID]
     DoCmd.OpenForm stDocName, , , stLinkCriteria
 
 End Sub

0
Rick
6/6/2010 12:24:32 PM
The vba is good for now as far as changing the form to Data Entry to Yes, 
however the RecordID is not = RecordID on the form that is opening. If there 
is nothing wrong with the vba below then it must be a problem somewhere else. 
Can you take another look?



     Dim stDocName As String
     Dim stLinkCriteria As String
     
     stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
     stLinkCriteria = "[RecordID]=" & Me![RecordID]
     DoCmd.OpenForm stDocName, , , stLinkCriteria
     Forms(stDocName).DataEntry = False

    
End Sub


Thanks.
Iram



"Rick Brandt" wrote:

> Iram wrote:
> 
> > Hello,
> > Below is vba on the On Click of a command button that is used to open a
> > form called "frm_AltaDeRegistrosPagina1-2Analista", match the Record ID to
> > the local form's Record ID, then make the "Data Entry" attribute = No. For
> > some reason it is not working correctly. I need the vba to change the
> > "Data Entry" attribute = No, so that I can modify the data on that form.
> > The said form above is usually used to add records using the "Data Entry"
> > attribute and via
> > using the switchboard "Add Record" setting. Now I  need to access the same
> > form to modify records. Can you help me fix the below vba and could you
> > also type up vba for me to put on the "On Close" of the form so that the
> > vba sets the "Data Entry" setting back = Yes?
> > 
> > Private Sub ModificarRegistrante_Click()
> > 
> >     Dim stDocName As String
> >     Dim stLinkCriteria As String
> > 
> >     stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
> >     DoCmd.OpenForm stDocName, , , stLinkCriteria
> >     stLinkCriteria = "[RecordID]=" & Me![RecordID]
> >     Forms(stDocName).DataEntry = False
> > 
> > End Sub
> 
> You need to set the value of stLnkCriteria *before* you use it.  And with a 
> WHERE clause you don't need to mess with the DataEntry property at all.
> 
>  Private Sub ModificarRegistrante_Click()
>  
>      Dim stDocName As String
>      Dim stLinkCriteria As String
>  
>      stDocName = "frm_AltaDeRegistrosPagina1-2Analista"
>      stLinkCriteria = "[RecordID]=" & Me![RecordID]
>      DoCmd.OpenForm stDocName, , , stLinkCriteria
>  
>  End Sub
> 
> .
> 
0
Utf
6/6/2010 4:17:25 PM
On Jun 6, 11:17=A0am, Iram <I...@discussions.microsoft.com> wrote:
> The vba is good for now as far as changing the form to Data Entry to Yes,
> however the RecordID is not =3D RecordID on the form that is opening. If =
there
> is nothing wrong with the vba below then it must be a problem somewhere e=
lse.
> Can you take another look?
>
> =A0 =A0 =A0Dim stDocName As String
> =A0 =A0 =A0Dim stLinkCriteria As String
>
> =A0 =A0 =A0stDocName =3D "frm_AltaDeRegistrosPagina1-2Analista"
> =A0 =A0 =A0stLinkCriteria =3D "[RecordID]=3D" & Me![RecordID]
> =A0 =A0 =A0DoCmd.OpenForm stDocName, , , stLinkCriteria
> =A0 =A0 =A0Forms(stDocName).DataEntry =3D False
>
> End Sub
>
> Thanks.
> Iram
>
> "Rick Brandt" wrote:
> > Iram wrote:
>
> > > Hello,
> > > Below is vba on the On Click of a command button that is used to open=
 a
> > > form called "frm_AltaDeRegistrosPagina1-2Analista", match the Record =
ID to
> > > the local form's Record ID, then make the "Data Entry" attribute =3D =
No. For
> > > some reason it is not working correctly. I need the vba to change the
> > > "Data Entry" attribute =3D No, so that I can modify the data on that =
form.
> > > The said form above is usually used to add records using the "Data En=
try"
> > > attribute and via
> > > using the switchboard "Add Record" setting. Now I =A0need to access t=
he same
> > > form to modify records. Can you help me fix the below vba and could y=
ou
> > > also type up vba for me to put on the "On Close" of the form so that =
the
> > > vba sets the "Data Entry" setting back =3D Yes?
>
> > > Private Sub ModificarRegistrante_Click()
>
> > > =A0 =A0 Dim stDocName As String
> > > =A0 =A0 Dim stLinkCriteria As String
>
> > > =A0 =A0 stDocName =3D "frm_AltaDeRegistrosPagina1-2Analista"
> > > =A0 =A0 DoCmd.OpenForm stDocName, , , stLinkCriteria
> > > =A0 =A0 stLinkCriteria =3D "[RecordID]=3D" & Me![RecordID]
> > > =A0 =A0 Forms(stDocName).DataEntry =3D False
>
> > > End Sub
>
> > You need to set the value of stLnkCriteria *before* you use it. =A0And =
with a
> > WHERE clause you don't need to mess with the DataEntry property at all.
>
> > =A0Private Sub ModificarRegistrante_Click()
>
> > =A0 =A0 =A0Dim stDocName As String
> > =A0 =A0 =A0Dim stLinkCriteria As String
>
> > =A0 =A0 =A0stDocName =3D "frm_AltaDeRegistrosPagina1-2Analista"
> > =A0 =A0 =A0stLinkCriteria =3D "[RecordID]=3D" & Me![RecordID]
> > =A0 =A0 =A0DoCmd.OpenForm stDocName, , , stLinkCriteria
>
> > =A0End Sub
>
> > .

wow.  Didn't they just tell you that it's the OpenForm that's wrong?
One of the arguments of the OpenForm method is which mode to open the
form in - edit/add/read only... and you didn't pick one.  If you
don't, it defaults to read/write.

DoCmd.OpenForm stDocName, acNormal, , , acFormReadOnly, acWindowNormal

It's just amazing what you can do if you actually start typing the
code ... IntelliSense actually gives you all the arguments you need...
you just have to pick them.  Try scraping the cobwebs outta your head
and using it....

0
Piet
6/7/2010 5:27:52 AM
Reply:

Similar Artilces:

EXCEL Mask for data entry
I don't have MS Access but I want to create an Access type Entry Mask for the entry of data into appropriate cells within a background work sheet. I want to create this as a simple entry form for non Excel users. The form would have 6 column and there would be a need for a look up table so when I entered an equipment asset number, its appropriate serial number would auto insert? Am I being too hopeful that such a facility exists within Excel? If by chance it does, where would I look for instructions? Hopefully Bill This is very possible in Excel but there are a few things to unde...

Outlook 2002 crashes when exporting data
When I use the "Import and Export" option from the File menu and choose "Export to a file" , Outlook 2002 crashes in module RM.DLL. I'm running all of the latest service packs for both Windows XP and MS Office Pro 2002. Any clues that will help me identify the cause of this problem will be greatly appreciated. Thanks, Jack ...

Use Combo Box to Select Month to Display Data on Chart
Hi All, I have a bar graph that shows the following information X Axis = Date Y Axis = Copper Produced Question: How can I enable the user to select a month from a drop-down list and the chart show the data only for the selected month? -- Carlee Here are a couple ways: http://peltiertech.com/Excel/Charts/ChartByControl.html http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=246 - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "Carlee" <Carlee@discussions.microsoft.com> wrote in message news:7779E1...

Extracting certain rows from data
I have a 4 column/4000 row spreadsheet. I need to extract the data on only every 10th row. So I need 10, 20, 30, 40, 50, etc. I don't care if the data is on the same spreadsheet, or on another one. I just can't figure out how to do it. Anyone up for the challenge? All help is appreciated. This example will copy the rows to a sheet with the name Sheet2 Sub copytest() Dim R As Long Dim rng As Range For R = 10 To 100 Step 10 Set rng = Sheets("sheet2").Range("A" & Rows.Count). _ End(xlUp).Offset(1, 0) Rows(R).Copy rng ...

Getting data from Access to Excel
Hi, i don't know if any body can helps me on this issue i wrote a code as below but no data goes to recordset i think this is because of date format or something like this because i can copy the fieds name the vaiables FrstDate shows "12/31/2009" and LstDate shows "1/28/2010" please help. Sub bbb() Dim rst As New ADODB.Recordset Dim conn As New ADODB.Connection Dim str1 As String Dim sID As String Dim iCost As Integer str1 = "" sID = "" Dim sPN As String sPN = "" Dim i As Integer ...

Send MSA 03 data in body of e-mail
I used to send data in the body of an e-mail from MSA 2000 I now have been working with 03 and it only allows me to send it as an attachment. How can I get a record to be sent as the body of an e-mail ...

I'm no longer able to enter data at the top of the screen
The data entry line just below the tool bars is now grayed out. For instance, if I select a cell, the data in that cell no longer appears in the data entry line. One guess ... Try click View > Formula bar It may be hidden .. -- Max Singapore --- "BookLover" wrote: > The data entry line just below the tool bars is now grayed out. For instance, > if I select a cell, the data in that cell no longer appears in the data entry > line. ...

concatenate string with "and" before last entry
Concatenate has opened a whole new world, but I have one question: I am using Concantenate to create a string of roles together for a letter. For example "Thanks for serving as Role1, Role2". Is it possible to tell the report to insert an "and" before the last role so it would read: "Thanks for serving as Role1, and Role2". Some of our members have served in over 15 roles, but either way the letter may not pass the board if it doesn't have the "and". I am not sure what information would be useful, so I will offer this at this time: My concate...

data base corrupted again
This is a multi-part message in MIME format. ------=_NextPart_000_00F9_01CAC02E.328F9660 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable once again data base is corrupted and will not compact. due to oversize data base. did a sync on a news group with over 50K messages. from that point on data base was shot. trying to compact got the message that file was in use. ended up deleting message store and creating it AGAIN . this needs to be fixed. you cannot create an account with lots of groups each with thousands of = ...

Can I permanently delete/hide data within Pivot Tables?
Microsoft Excel 2002 I have 155 clients which I need to run Pivot Tables for! All with the same pivot table layout. Is it possible to run the Pivot table with the 155 clients as a Template basically, then somehow delete or permanently hide the data leaving only one client, so that I can save multiple copies for each of the individual clients? Or can I set up a pivot table where I can automatically feed in parameters? Client details are stored on an Oracle database! Hi Peter, Right-click on a Page Field and select Field Settings from the context menu, then click the Advanced button. Yo...

Migrating Tasks with Data Migration Framework
I've been working on a migration project from Goldmine to MS CRM. So far, I've migrated all accounts (6000+) and contacts (10000+) through DMF and subsequently used DMF to migrate all phonecalls (18000) & emails (300) successfully. However, when i try to migrate tasks (19000) the DMF simply doesnt migrate anything. The log says - "Failed to migrate object: Server was unable to process request". This message isnt of much help to nail down the issue. I ran a stored procedure to create 2 activityparty records for each participant in cdf_activityparty (one each for the user ...

PivotTable "show data value as" question
Hi all, I have a problem about using Pivot Table in Excel 2003: In a pivot table I have a date field, grouped by year and month, as the row field. The data field of the table is anything that can be summed. Now when I tried to display the data field value as "Difference from previous month", I found that January of each year is always blank, ideally the data value in January should be display as the difference between the actual January value minus December value of the last year. Any tricks to show them? Thanks a lot. Frederick Chow Hong Kong. If you group the dates by ...

Insert formula even cells with data below it
Using this code Sub Insertformula () For Check = 4 To 40000 Step 2 If Cells(Check, "b") <> "" Then Cells(Check, "b") = "=IF(OR(I5="",J5=""),"",NETWORKDAYS(I5,J5,Holidays!A$1:A$39)-1)" Next Check End Sub My objective is to put this formula =IF(OR(I5="",J5=""),"",NETWORKDAYS(I5,J5,Holidays!A$1:A$39)-1) Into every even cell in Column B with data below it. However if you tried the macro you would see it does not work. If I could get any help thank you. Please tell ...

Need to read PAR PORT data bits URGENT
I have never read a parallel port in MFC yet. I need to read the input data on the port tonight for a dog and pony tomorrow. I tried the CParallelPort class but it didn't build and seems more than I really needed.. I am just reading the state of the bits as there is a rotary switch connected to them.. ANy links or methods.. AM I missing the obvious? Thanks again all. Nappy First, using the parallel port for anything is intrinsically dangerous. The standard parallel port driver does not support reading from it. (Besides, modern machines don't have parallel ports). You wil...

Pivot Table: How can I organize data items in a row?
Hi, I am trying to build a pivot table which has categories only in row fields but not in column fields. Instead, the data items should be organized in columns instead of rows. For example, this is what I have now with two data items (habitants and location): inhabitants Country location --------------------------- USA 240 America Britain 60 Europe Japan 120 Asia But I want this: Country inhabitants location ------------------------------------- USA 240 America Britain 60 Europe Japan 120...

Count matching data
I have a spreadsheet with 14 columns and 20 rows - and what I would like is a formula that will look in a particlular row i.e B1:B14 and return and X in cell B15 if consequtive cells of 4 or more initials are found e.g. if B1:B2:B3:B4 = TT in each cell then the result in B15 would be X and if c3:c4:c5:c6 = MM the result in B16 would be X. If however B1:B2:B3 = TT and B4 = NN then no X is returned (cells will either contain initials or be blank) is this possible? -- Barny On Mon, 26 Apr 2010 15:58:59 +0100, Barny <Barny.61b9534@excelbanter.com> wrote: > &...

Excel
I have a problem with an excel spreadsheet that i need help with... I am studying a road network and it is represented by points (nodes) and the space inbetween these is the road. My problem is that obviously a road goes from say point A to point B but also back the way from point B to point A. The data i have contains both data from point A to point B but also from point B to point A. This data is identical and to i'd like to delete the repeated data from B to A. The problem is that point A may go to up to 5 other locations, ie to B,C,D,E or - as roads do at a junction. Therefore ...

CRM 3.0
Hi I am building a CRM 3.0 Virtual PC development environment, and I want to populate the CRM with test data. I have seen the Adventure Works Cycle CRM Virtual PC, but it uses SQL Server 2005. We are using SQL Server 2000. How can I get the Adventure Works data into my Virtual PC? Are there any scripts anybody has developed to add a heap of data into CRM? Tom ...

ISNA VLOOKUP any data prefixed with a "C7" cannot be found?
Currently working on a quotation workbook, whereby monthly data dumps result in users being able to create a quote by cutting in product codes. Major problem is that any time a product code that is prefixed with "C7" is entered the product description is NOT pulled through onto the quotation form. Any suggestions on how to fix this would be much appreciated!:confused: -- Mike Jenkins ------------------------------------------------------------------------ Mike Jenkins's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=29588 View this thread: http://ww...

Data Source Displayed in Web Part?
Currently I have a Team Site which has a subsite containing 1 document library and what I'm trying to do is diplay this subsite doc library on the parent site. Considering this library is not an option to add from the browsers "add webpart" functionality, I assume this needs to be done through SP Designer? Do I need to add the data source first? And if so, how do I then display this as a web part? Again, the goal is simply to display the sub-site's doc library as a webpart on the parent site. Please advise on the best way to accomplish this. -- Thanks,...

Formulas to reference range based on data in column
I probably didn't title this too well. I have a spreadsheet with 500 rows of data, sorted by the date in column A. I want to extract certain data from rows that all start with the same specified date. Previously I used an IF formula but that necessitates having the formula in 500 rows which won't work for my purposes. I'm going round incircles trying to think how best to achieve this. If you apply a filter to the date column for the selected date you can then just highlight the visible rows and copy/paste or cut/paste them elsewhere (eg another sheet) to extract ...

Attaching a 2003 Access data base to an email for use with Office
I was using Win XP with Office 2003 and have just installed Windows 7 and Windows Live Mail with Office 2007. I have two other sites which also are using Office 2003 and heretofore, we have had no problems emailing data bases back and forth. But now, Windows Live Mail won't permit our exchanging .mdb files as we have in the past. So, I was told that if we change the .mdb to ..txt we could email and get by Windows Live validation. That does get by the validation, but I am having the problem of changing the .txt data base to ..mdb and getting it to open in Access. Any sugge...

Collecting Data on the Internet
I'm not sure where I should post this. I have a web page and I would like visitors to be able to submit their name and address and this information be added as a row in an Excel spreadsheet. Can I do something like this? Is their someplace that explains how to do this? Thank you. ...

Two field entry questions
I don't know if VBA will be involved, but... I have a Word document with some tables and some of the cells of that table should have text entered. What I'd really like to have those cells which require entry to initially be yellow in color, but whenever text is entered (either when the cursor has left the table cell, or also acceptable when any text appears in the table cell) the background color should go away. My second question is that there are some places in my document where I have entered spaces with an underline to indicate that it should be filled out. However, wh...

Collecting data through email using VBA
Hi, I know that the "Create Email" tool in order to collect data through email but I want to do it automatically. My database form includes VBA code in order to send automate emails. I'd like to make this email "special" in order to receive the replay into access and use the answer email. I'd be grateful if someone could help me with the VBA code. Thanks! This capability is included in Access 2007, if you are using the .accdb file format, although you still need to initiate the process (ie. it is not fully automatic). What version of Access are you using? ...