Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 17th, 2005, 06:56 PM
Authorized User
 
Join Date: Feb 2005
Location: Lincoln, , United Kingdom.
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forms question

Hi all, thanks to those who helped me on the previous post, makes it alot clearer. I have been creating forms for my current assignment which is working quite well. Whenever i go back to a form, I notice that you can change any of the previously entered data, I have already done this accidently a couple of times. Is there anyway that once you have entered a form, the next time you want to change that page you have to press an edit button? For example, using the members list, a member enters all their details and the next member to use the database could ammend any of the previous information entered. It would be nice for the page to be read only once the data was entered, unless you pressed an edit button. Can anyone help???????? Jason

Reply With Quote
  #2 (permalink)  
Old February 17th, 2005, 07:39 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

You can set no-cache option on top of your page.

Please check the following options:
<%
Response.Expires = 60
Response.Expiresabsolute = Now() - 1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "no-cache"
%>

http://www.learnasp.com/learn/cachenomore.asp


Om Prakash
Reply With Quote
  #3 (permalink)  
Old February 17th, 2005, 11:15 PM
Authorized User
 
Join Date: Feb 2005
Location: Frankston South, Victoria, Australia.
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Jason

Maybe I didn't understand your question looking at the reply Om gave you but in case you are talking about an Access form in a .mdb file try the following:

Set the AllowEdits form's property to false (this way is is impossible to change the data) and add the following code to your OnCurrent form event:

Private Sub Form_Current()
    If Me.NewRecord Then
        Me.AllowEdits = True
    Else
        Me.AllowEdits = False
    End If
End Sub

So, only when you're a new record you can change it.

Now add the following code to the OnClick event of a Command button:

Private Sub cmdEdit_Click()
    Me.AllowEdits = Not Me.AllowEdits
    If Me.AllowEdits Then
        Me.Caption = Me.Caption & " (Edit Mode)"
    Else
        Me.Caption = Me.Caption & " (Read Only)"
    End If
End Sub

There you go. Click the button to allow editing of the current record only. Move to another record and it becomes read only again. The Caption stuff is there only to make it more clear for the users what mode they are in.

Hope this helped
Daniel

Daniel
Reply With Quote
  #4 (permalink)  
Old February 18th, 2005, 05:01 PM
Authorized User
 
Join Date: Feb 2005
Location: Lincoln, , United Kingdom.
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks to all for the help. Much appreciated.

Jason

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question about forms danastasio Classic ASP Databases 0 October 1st, 2007 01:04 PM
continuous forms question hamffjs Access 3 January 29th, 2007 01:33 PM
Forms Question biglazy Access 3 December 23rd, 2005 12:22 PM



All times are GMT -4. The time now is 11:48 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.