PC Review


Reply
Thread Tools Rate Thread

Data Entry = No

 
 
Iram
Guest
Posts: n/a
 
      6th Jun 2010
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
 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      6th Jun 2010
On Sat, 5 Jun 2010 19:27:54 -0700, Iram <(E-Mail Removed)>
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]
 
Reply With Quote
 
Iram
Guest
Posts: n/a
 
      6th Jun 2010
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 <(E-Mail Removed)>
> 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]
> .
>

 
Reply With Quote
 
Bob Quintal
Guest
Posts: n/a
 
      6th Jun 2010
=?Utf-8?B?SXJhbQ==?= <(E-Mail Removed)> wrote in
news921383A-C22B-4A45-AD9E-(E-Mail Removed):

> 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




 
Reply With Quote
 
Iram
Guest
Posts: n/a
 
      6th Jun 2010
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
>
> .
>

 
Reply With Quote
 
Rick Brandt
Guest
Posts: n/a
 
      6th Jun 2010
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

 
Reply With Quote
 
Piet Linden
Guest
Posts: n/a
 
      7th Jun 2010
On Jun 6, 11:17*am, 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 = 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 opena
> > > 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

>
> > .


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....

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Online Data Entry, Offline Data Entry with Data Entry Services James Roy Microsoft Access Forms 1 3rd Feb 2009 12:45 PM
Save 60% on Data Entry, Data Conversion, Data Processing Services byOffshore-Data-Entry dataentryoffshore@gmail.com Microsoft Excel Programming 0 4th Jun 2008 04:02 PM
Save 60% on Data Entry, Data Conversion, Data Processing Services byOffshore-Data-Entry dataentryoffshore@gmail.com Microsoft Excel Programming 0 4th Jun 2008 04:00 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Excel Misc 0 20th Mar 2008 12:45 PM
Data Entry Online, Data Format, Data Conversion and Data EntryServices through Data Entry Outsourcing admin.dataentryoutsourcing@gmail.com Microsoft Access Form Coding 0 20th Mar 2008 12:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:23 AM.